0.1.1 • Published 7 years ago

functional-json v0.1.1

Weekly downloads
-
License
BSD-3-Clause
Repository
bitbucket
Last release
7 years ago

Functional JSON wercker status

An enhanced JSON serializer & parser that can encode functions.

API Reference

Installing / Getting Started

Install the package

npm install --save functional-json

and import/require it

import FJSON from 'functional-json';
// OR (pre ES6)
var FJSON = require('functional-json');

Usage

const str = FJSON.stringify({
  key: 'value',
  fn: (v) => v + 1
});

FJSON.parse(str).fn(0); // 1

Developing

This is what you do after you have cloned the repository:

npm install
npm run build

(Install dependencies & build the project.)

Linting

Execute ESLint

npm run lint

Try to automatically fix linting errors

npm run lint:fix

Testing

Execute Jest unit tests using

npm test

Tests are defined in the same directory the module lives in. They are specified in 'module.test.js' files.

Building

To build the project, execute

npm run build

This saves the production ready code into 'dist/'.

Documentation

The app is documented using JSDoc. To generate docs, use

npm run docs

This saves HTML documentation into 'docs/'. It requires that you have additionally installed jsdoc.

To generate a Markdown API reference, you can alternatively use

npm run docs-md

This saves the documentation into 'docs/index.md'. It requires that you have additionally installed jsdoc-to-markdown.