Overview
b5 projects are saved as.b5.json files - human-readable JSON documents that store your entire project including the Playground canvas, Factory definitions, and all block configurations.
b5 uses keyboard shortcuts familiar to most applications:
- Save:
Cmd+S(Mac) orCtrl+S(Windows/Linux) - Load: Drag and drop the
.b5.jsonfile into the editor
Saving Your Project
Choose Location
Your browser will prompt you to choose where to save the file. The filename is automatically generated with a timestamp.
Loading a Project
Understanding the .b5.json Format
The.b5.json file is a structured JSON document with three main sections:
File Structure
| Section | Description |
|---|---|
playground | Contains all blocks and wires in your main canvas |
factory | Stores custom variables, functions, and objects |
version | b5 editor version used to create the file |
Playground Structure
Factory Structure
Block Anatomy
Every block in a.b5.json file contains these key properties:
Block Properties
| Property | Type | Description |
|---|---|---|
name | string | Block type identifier |
source | string | Origin: "original" (built-in), "custom" (user-made), or "library" (imported) |
uuid | string | Unique identifier for this block instance |
inlineData | array | Values stored directly in the block (for inputs, sliders, color pickers, etc.) |
input | object | Wire connections to input nodes (format: {"nodeIndex": ["line", "block", "outputNode"]}) |
output | object | Wire connections from output nodes to other blocks |
Wire Connection Format
Wire connections use a coordinate system["line", "block", "node"]:
- Input node
0of this block - Connects to output node
0 - Of block at position
1 - On line
3
null means no connection for that input node.Block Source Types
Original Blocks
circle, rect, number, add).
Custom Blocks
Library Blocks
posenet from the PoseNet library).
Example: Complete Project File
Here’s a simplified complete.b5.json file:
Line Styles
ThelineStyles object can store styling information for entire lines:
Version Compatibility
Theversion field indicates which version of b5 created the file:
Working with Example Files
b5 comes with several example.b5.json files:
example1.b5.json- Bounce Ball demonstrationexample2.b5.json- PoseNet machine learning exampleexample3.b5.json- Additional creative coding examplesexample4.b5.json- More advanced techniques
Loading Examples
Click the Files icon (📁) at the top left corner of the editor to load random example files with detailed comments.Advanced: Manual Editing
Since.b5.json files are plain text, you can edit them manually:
Best Practices
- Save Frequently: Use
Cmd+S/Ctrl+Sregularly to avoid losing work - Organize Files: Use descriptive filenames when renaming downloaded files
- Version Control: Keep multiple versions as you develop (e.g.,
project-v1.b5.json,project-v2.b5.json) - Backup Important Work: Store copies in multiple locations
- Test After Loading: Verify your project works correctly after loading
Sharing Projects
The.b5.json format makes sharing easy:
- Save your project
- Share the
.b5.jsonfile via email, cloud storage, or GitHub - Recipients can drag and drop the file into their b5 editor
- The project loads with all blocks, connections, and custom definitions intact
In the future, b5 will support direct project sharing through the editor interface. For now, manual file sharing is the recommended method.
Troubleshooting
File won’t load?- Check that it’s a valid
.b5.jsonfile - Ensure the JSON structure is not corrupted
- Try opening in a text editor to verify contents
- The file may have been created with a different b5 version
- Custom blocks from libraries you don’t have installed won’t appear
- Check the console for error messages
- Wire connection coordinates may be incorrect
- Blocks may have been removed that wires referenced
- Try manually recreating connections in the editor
Future: b5.js Rendering
In future versions,.b5.json files will be executable by the standalone b5.js rendering engine, allowing your projects to run on any website without the full editor.
Learn more: b5.js Integration
Next Steps
b5.js Integration
Learn about the rendering engine that executes .b5.json files
Custom Variables
Understand how variables are stored in the JSON format