0.0.6 • Published 7 years ago

string-mangle v0.0.6

Weekly downloads
5
License
ISC
Repository
github
Last release
7 years ago

Install

$ npm install --save string-mangle

Usage

const Smangle = require('string-mangle');
const obj ={name:'liangklfangl',sex:'male'};
console.log(Smangle.stringify(obj));

Then you will get something bellow(A valid json):

{
  "name": "liangklfangl",
  "sex": "male",
  "school": {
    "location": "DLUT",
    "age": 68
  }
}

API

(1)stringify:func(obj):

This method will stringify an object as above

(2)stringifyTree:func(fileTree)

This method will stringify an file tree object.

Input is:

const filetree = { filelists:
   { hello: 'filelists/hello.md',
     index: 'filelists/index.md',
     md:
      { fol: { 
        index: 'filelists/md/fol/index.md'
         },
        index: 'filelists/md/index.md' 
     }
 }
}

Then you get something bellow returned:

{
  'filelists': {
    'hello': require('C:/Users/Administrator/Desktop/string-mangle/filelists/hello.md')
    'index': require('C:/Users/Administrator/Desktop/string-mangle/filelists/index.md')
    'md': {
      'fol': {
        'index': require('C:/Users/Administrator/Desktop/string-mangle/filelists/md/fol/index.md')
      }
      'index': require('C:/Users/Administrator/Desktop/string-mangle/filelists/md/index.md')
    }
  }
}

If you just want to return an string object without required call, please use stringify instead!

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago