rison2
v0.3.0
Published
Rison2 is a parser/stringifier of Rison
Downloads
3,600
Readme
Rison2
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 rison2Usage
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: '漢字' }Node.js Support Policy
Rison2 supports Node.js versions that are currently in Active LTS or Maintenance LTS. This ensures compatibility with stable and actively supported Node.js environments.
Contributing
- Fork it ( http://github.com/kou64yama/rison2/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
