Table of Contents
About
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
Use
You can use ion-js either as a Node.js module or inside an html page.
NPM
- Add
ion-js
to your dependencies usingnpm
npm install --save-dev ion-js
- Use the library to read/write ion data. Here is an example that reads Ion data from a JavaScript stringTry it yourself.var ionJs =var ionData = "{ hello: \"Ion\" }";var ionReader = ionJs;ionReadernext;ionReader;ionReadernext;var hello = ionReader;var ion = ionReader;ionReader;console;
Browser
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
<!-- more HTML/JS code that can now use `window.ion` to create/write Ion -->
API
Contribute
License
Links
- Ion
- Ion Specification
- Ion Cookbook uses the Java library for its examples.
- Ion C
- Ion Java
- Ion Python