0.2.3 • Published 8 months ago

rison2 v0.2.3

Weekly downloads
26
License
MIT
Repository
github
Last release
8 months ago

Rison2

Node.js CI codecov FOSSA Status

Rison2 is a parser/stringifier of Rison.

Rison is a slight variation of JSON that looks vastly superior after URI encoding. Rison still expresses exactly the same set of data structures as JSON, so data can be translated back and forth without loss or guesswork.

Installation

$ npm install rison2

Usage

Rison2 has a JSON-like interface.

import { RISON } from 'rison2';

console.info(RISON.stringify({ message: 'こんにちは,世界' }));
// '(message:こんにちは,世界)'

console.info(RISON.parse('(message:こんにちは,世界)'));
// { message: 'こんにちは,世界' }

If you need percent encoding, import rison2/lib/escaped instead of rison2.

import { RISON } from 'rison2/lib/escaped';

console.info(RISON.stringify({ kanji: '漢字' }));
// '(kanji:%E6%BC%A2%E5%AD%97)'

console.info(RISON.parse('(kanji:%E6%BC%A2%E5%AD%97)'));
// { kanji: '漢字' }

Contributing

  1. Fork it ( http://github.com/kou64yama/rison2/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

MIT License

FOSSA Status

0.3.0-alpha.9

9 months ago

0.3.0-alpha.11

8 months ago

0.3.0-alpha.12

8 months ago

0.3.0-alpha.10

9 months ago

0.3.0-alpha.2

2 years ago

0.2.3

2 years ago

0.3.0-alpha.1

2 years ago

0.2.1

3 years ago

0.2.2

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.0

3 years ago