Name: ion-js
Owner: Amazon
Description: A JavaScript implementation of Amazon Ion -- this is currently alpha software and is subject to change
Created: 2016-10-31 18:31:32.0
Updated: 2018-01-18 20:25:15.0
Pushed: 2018-01-12 01:21:31.0
Size: 1056
Language: TypeScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Ion-JS is a JavaScript library for Ion – this is currently alpha software and is subject to change. The library allows for reading/writing Ion data from within JavaScript code.
For more information on Ion have a look at the Ion Specification as well as some of the other Ion language specific libraries such as
You can use ion-js either as a Node.js module or inside an html page.
ion-js
to your dependencies using npm
install --save-dev ion-js
ionJs = require("ion-js")
ionData = "{ hello: \"Ion\" }";
ionReader = ionJs.makeReader(ionData);
eader.next();
eader.stepIn();
eader.next();
hello = ionReader.fieldName();
ion = ionReader.stringValue();
eader.stepOut();
ole.log(ion.concat(", ").concat(hello));
Try it yourself.You can include the Ion-js bundle (ES5 compatible) using the URLs
These will create and initialize window.ion
which has the exact API as our npm
package. Here is an example
l>
d>
eta charset="UTF-8"/>
cript src="scripts/ion-bundle.min.js"></script>
-- more HTML/JS code that can now use `window.ion` to create/write Ion -->
ad>
ml>