ProcessingDB is a software development tool for JavaScript and HTML which provides:
- a browser-based code editor which allows you to save and run your code
- the ability to save and publish of all versions of your code
- support for dependency management and deployment
Concepts
Scripts
- Every piece of code stored in ProcessingDB is referred to as a "script".
- Each script has an id number, and each script version has a revision number.
- When a script is saved, its revision number is incremented.
- All script versions are published at URLs of the form
processingdb.org/edit/scriptId.revisionNumber.- For example,
http://processingdb.org/edit/4.2edits the script whose id is 4, revision number 2.
- For example,
Modules
- ProcessingDB supports
requireandexportsfrom CommonJS Modules.- Modules can be required using the syntax
var foo = require('foo'). - Modules define their exported API by adding properties to an
exportsobject.
- Modules can be required using the syntax
- Each module in ProcessingDB has a unique name, say
moduleName. - A script declares itself to be a module by using the directive
@module moduleName.
Templates
- Templates are HTML pages with placeholders of the form
${parameterName}.- Parameter values are passed in from applications which use the template.
${code}is a special placeholder which gets replaced by application code bundled with its dependencies.
- Each template in ProcessingDB has a unique name, say
templateName. - A script declares itself to be a template by using the directive
@template templateName.
Applications
- Applications are scripts which can be run.
- Applications can depend on modules using
require, just like modules can. - When an application is run, it is bundled with its dependencies and embedded into a template.
- Module and app code is bundled together based on this compilation strategy from the CommonJS Wiki
- A script declares itself to be an application by using the directive
@app template templateName. - Applications can pass parameters to the template using directives of the form
@app parameterName value.
Examples
- The CommonJS math example has been imported to ProcessingDB:
