Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ion-js

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ion-js

A JavaScript implementation of the Ion data interchange format

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
increased by6.13%
Maintainers
1
Weekly downloads
 
Created
Source

Table of Contents

About

Ion-JS is a Javascript library for Ion. 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

  1. Add ion-js to your dependencies using npm
    npm install --save-dev ion-js
    
  2. Use the library to read/write ion data. Here is an example that reads Ion data from a Javascript string
    var ionJs = require("ion-js")
    
    var ionData = "{ hello: \"Ion\" }"; 
    var ionReader = ionJs.makeReader(ionData); 
    ionReader.next(); 
    ionReader.stepIn(); 
    ionReader.next(); 
    var hello = ionReader.fieldName(); 
    var ion = ionReader.stringValue(); 
    ionReader.stepOut(); 
    console.log(ion.concat(", ").concat(hello));
    
    Try it yourself.

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

<html>
<head>
  <meta charset="UTF-8"/>
  <script src="scripts/ion-bundle.min.js"></script>

  <!-- more HTML/JS code that can now use `window.ion` to create/write Ion -->
</head>
</html>

API

Ion JS API

Contribute

CONTRIBUTE.md

License

Apache License 2.0

Keywords

FAQs

Package last updated on 25 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc