< Previous Article Next Article >

What is Profound.js?

Spaces are powered by a robust server-side framework called Profound.js, or simply pjs.

Profound.js simplifies application development by giving you capabilities, such as:

  • Hot reloading
  • Improved error reporting
  • Seamless database integration
  • Strong data types for business data
  • Authentication and session handling
  • Easy to use API that eliminate callback hell

Many of these capabilities are transparent to you, as a Profound.js Spaces user; however, you will want to use some of the Profound.js API directly in your Profound.js Spaces application code. This section of our docs describes the most relevant API.

Accessing pjs API

When Profound.js Spaces calls your Node.js stateful application module or a stateless Express route module, it automatically injects the pjs object into that module.

Attached to the pjs object are a number of methods or API. For, example the code below uses the pjs.wrap() API to eliminate callbacks when using JavaScript's setTimeout.

// Sample app.js code...
function app() {
  // pjs object is avaialble here!
  let delay = pjs.wrap(setTimeout);
  delay(1000);  // use setTimeout without a callback to pause for 1 second
exports.default = app;


Have questions about this topic? Ask for help on our Profound.js Spaces Discussion Forum.

< Previous Article Next Article >