Documentation Menu


You can import jsnlog.js into your ES6 code using an ES6 import statement:

import {JL} from 'jsnlog';

You can then use JSNLog normally in your JavaScript code:

JL().info("log entry from ES6 code");

You probably transpile your ES6 code to ES5 with something like Babel. This will convert the ES6 import to a CommonJS require, so effectively you will be loading jsnlog.js as a CommonJS module.

jsnlog.js is available from NPM and has the necessary code to function as an CommonJS module.

CommonJS is normally used on the server, because it doesn't support asynchronous loading by the client over the network. However, Browserify enables you to use this on the client.