tnetstrings javascript implementation
JavaScript Python HTML Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ref
.gitignore
LICENSE
README.md
package.json
test.html
test_case.sh
tests.js
tnetstrings.js

README.md

tnetstrings.js

tnetstrings implementation in JavaScript. See link for more information on tnetstrings.

How to use

Just include tnetstrings.js on your web page with:

<script src="tnetstrings.js"></script>

and you'll have global object tnetstrings in your JavaScript context. Usage is as simple as calling tnetstrings.parse(data) and tnetstrings.dump(obj). Note though that using parse() will return an object with two fields - value and extra, former containing parsed object (or string, or whatever) and latter containing remaining of string which was not parsed. If passed string contained only tnetstring, extra will contain empty string and can be ignored.

Node.js

Library is on NPM as tnetstrings.js. Or you can download tnetstrings.js and just require it:

var tnetstrings = require('tnetstrings.js');