This very simple demo shows how to import JSNLog in an ES6 NodeJs application and then log something to the console.
##How to install and run this demo##
- Download the zip file and expand on your computer;
- Open directory es6Demo. All relevant files are here;
- Have a look at es6Demo/es6/main.js. This is an ES6 file that imports and uses jsnlog;
- npm install to install gulp, jsnlog and babel (the ES6 transpiler);
- gulp to build the project. This transpiles es6Demo/es6/main.js into es6Demo/main.js;
- node main.js to run the transpiled file. jsnlog will write a log message to the command line.
Note that Babel transpiles the ES6 import statement to a CommonJs require. While you still have to use Babel instead of native ES6, use Browserify if you want to use the ES6 import statement on the client.
JSNLog for .Net logs to Log4Net, NLog, Elmah, Serilog and Common.Logging. Supports ASP.NET 4 and ASP.NET Core.
JSNLog for NodeJs runs on both the client and the server. It optionally uses Winston transports to log to MongoDb, etc.