Datasole, or **data** con**sole**, is a real-time data model server based on Webpack, Express.js, and WebSockets. It maintains a synchronized, shared data model (arbitrarily nested object) between a server application process and one or more connected cli
Last updated a year ago by mayanklahiri .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install datasole 
SYNC missed versions from official npm registry.


CircleCI Build Status DeepScan grade

Datasole, or data console, is a fast prototyping tool for realtime, full-stack Javascript web applications using Node and any reactive frontend Javascript framework. It works by maintaining a single shared data model (object) between a server process and multiple connected Websocket clients, as well as providing a thin RPC framework from client to server.

Datasole is based on (and abstracts; opinionates): Webpack, Express, and Websockets connections. It works well with frontend frameworks that support reacting to mutations on a shared data model, such as Vue, Angular, and React.

In development mode, Datasole allows full-stack applications to be interactively developed with the following features:

  • Hot Module Reloading (HMR) of the client SPA, via Webpack.
  • Application server (backend) restart on source file changes.
  • Asset bundling using an opinionated Webpack configuration.
  • Templating languages: Pug, HTML
  • Stylesheet languages: CSS, Sass (SCSS), LessCSS
  • Image formats (with optimizer): SVG, GIF, PNG, JPG, ICO
  • .vue single-file Vue.js components

The datasole build command runs the Webpack build in production mode to produce a static web distribution in the dist directory by default.


npm install -g datasole

Datasole can also be used as a locally installed library by omitting the -g flag.


Each command attempts sensible defaults. Help for each option: -h or --help


Start a new project by running datasole init in an empty directory.


Start a development webserver: datasole dev


Build a production version of the frontend: datasole build


Serve a production version of the frontend: datasole run (requires datasole build first)


The following environment variables affect Datasole's behavior. No environment variables are required by default.

See lib/config/defaults.js for the full list of environment variables.

Required variables, with defaults:

Environment variable Default Description
DISABLE_COLORS false Strip ANSI color codes from log messages.
DATASOLE_API_URL /api/v1 URL path to forward to application as REST requests.
DATASOLE_API_TIMEOUT_SEC 30 Maximum number of seconds before timing out an HTTP request.
DATASOLE_LISTEN_ADDRESS Local address to listen on ( = all interfaces)
DATASOLE_LOG_FORMAT text text or json
DATASOLE_LOG_LEVEL_APP info Datasole user application logging level.
DATASOLE_LOG_LEVEL_SYS info Datasole system runtime logging level.
DATASOLE_MODE production Datasole run mode: development or production
DATASOLE_PORT 8000 Port to listen on.
DATASOLE_STATIC_URL / Path to serve a fallback static distribution at.
DATASOLE_URL_ROOT_PATH / URL prefix for all paths, useful for path-based proxies.
DATASOLE_WEBSOCKET_URL __ws__ Relative path to listen for Websocket connections.

Optional variables, enables specific features if set (default: not set):

Environment variable Description
DATASOLE_LOG_OUTPUT_PATH Disk path to write logs to, or write to console if blank.
DATASOLE_STATIC_PATH Fallback static distribution disk path to attempt before error page.
DATASOLE_BUILTIN_TEMPLATE_PATH Override path containing Pug templates for built-in error pages.

URL Prefixes

All server URLs will be prefixed by DATASOLE_URL_ROOT_PATH. This is useful, e.g., behind a reverse proxy like nginx where different path prefixes map to different upstream backend servers, or behind cloud load balancers.


Logging Level

The following logging levels are supported for DATASOLE_LOG_LEVEL_APP and DATASOLE_LOG_LEVEL_SYS:

  • trace (most verbose)
  • debug
  • info
  • warn
  • error
  • fatal (silent)

Static Fallback Distribution

If the SPA does not contain a particular URL, Datasole optionally falls back to a static web distribution on disk.

If the DATASOLE_STATIC_PATH variable is set, any files at that path will be served as static content.

Example projects

See the datasole-examples repository.

Package maintainer notes

  • Webpack is not in devDependencies because recursive devDependencies are not currently installed by npm, and Webpack is required for developing the client and server components of any project. In the future, Webpack and other large dev dependencies can be moved to devDependencies by requiring a global npm install of datasole for development.

Source Statistics

Statistic Value
Total lines of code 4234
Source lines 3153 (74%)
Comment lines 600
Installed node_modules size 202M

Current Tags

  • 0.4.4                                ...           latest (7 months ago)

19 Versions

  • 0.4.4                                ...           7 months ago
  • 0.4.3                                ...           7 months ago
  • 0.4.2                                ...           7 months ago
  • 0.4.1                                ...           7 months ago
  • 0.4.0                                ...           8 months ago
  • 0.3.4                                ...           9 months ago
  • 0.3.3                                ...           9 months ago
  • 0.3.2                                ...           a year ago
  • 0.3.1                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.4                                ...           a year ago
  • 0.2.3                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (40)
Dev Dependencies (1)
Dependents (0)

Copyright 2014 - 2016 © |