0.5.0 • Published 3 years ago

json-to-js-const v0.5.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

json-to-js-const

JSON to JavaScript tree-shakeable constants.

Installation

npm add json-to-js-const

Usage

const convert from 'json-to-js-const';

const result = convert({ intValue: -12, strValue: 'haha"\'', nullValue: null, arrayValue: [32, 'wow', null] });
console.log(result);

It prints:

/******************************************************************************************
 * This code was automatically generated by json-to-js-const.
 * Do not edit this file manually, your changes will be overwritten.
 ******************************************************************************************/

export const intValue = -12;
export const strValue = 'haha"\'';
export const nullValue = null;
export const arrayValue = [32, 'wow', null];
0.5.0

3 years ago

0.1.0

4 years ago

0.0.2

5 years ago

0.0.1

5 years ago