GithubHelp home page GithubHelp logo

isabella232 / ion-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from derv82/ion-js

0.0 0.0 0.0 1.03 MB

A JavaScript implementation of Amazon Ion -- this is currently alpha software and is subject to change

License: Apache License 2.0

JavaScript 29.82% HTML 0.16% TypeScript 70.03%

ion-js's Introduction

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

  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

Links

ion-js's People

Contributors

therapon avatar kadishmal avatar msiyangamzn avatar mtcalvin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.