0.0.5 • Published 11 years ago

jsn v0.0.5

Weekly downloads
1
License
-
Repository
github
Last release
11 years ago

jsn Build Status

jsn is an open-source Node to JavaScript variable parser.

What does JSN do?

jsn will take variables you pass as a context, and parse the source code to produce valid JavaScript.

Sample .jsn file:

var thatMuch = '@how.awesome';
alert(thatMuch);

You will need to install jsn, you can do that directly from npm

npm install jsn

In your Node.JS code, you can parse these variables by accessing the jsn compiler.

var jsn = require('jsn');

jsn.parse(source, { how: { awesome: 'well, very much, tee-hee!' } }, function(err, js){
    if(err){
        throw err;
    }
    console.log(js); // valid js.
});

This is particularly useful when you have small pieces of data you want to pass to your JavaScript files. It's often most useful when paired with node-assetify, which supports jsn out the box.

To keep things simple, JSN supports only context variable names with A-z, -, or _ characters.

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago