json-to-js-const
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

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];

Readme

Keywords

none

Package Sidebar

Install

npm i json-to-js-const

Weekly Downloads

4

Version

0.5.0

License

MIT

Unpacked Size

4.74 kB

Total Files

6

Last publish

Collaborators

  • mgenware