Information
Package | gulp-json2js |
Description | Convert JSON object to JS file |
Node Version | ≥ 0.10 |
Usage
First, install gulp-json2js
as a development dependency:
npm install --save-dev gulp-json2js
Then, add it to your gulpfile.js
:
var json2js = ;var rename = ;var data = ; gulp;
Example:
local.json
"createdTime": "Wed May 11 2016 14:24:17 GMT+0800 (CST)" "count": 0 "list": "item00" "item01": "c" "b" 3 "person": "name": "Boguan" "nationality": "China" "a": "b": "c": "d": "e": "serial" "global": true
localModel.js
moduleexports = createdTime: createdTime count: count serial: ab'c''d'e name: personname person: person item: list li: list01item01;
local.js
moduleexports = createdTime: "Wed May 11 2016 14:24:17 GMT+0800 (CST)" count: 0 serial: "serial" name: "Boguan" person: "name":"Boguan""nationality":"China" item: "item00""item01":"c""b"3 li: "c";
LICENSE
Copyright (c) 2016 Bo Guan
Licensed under the MIT license.