Skip to content

mbrandt-art/obj-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

obj-string

Convert objects to strings for code generation

Usage

See all valid object properties and limitations here

import { stringifyObject } from 'obj-string'

let str = stringifyObject({
  data: {
    list: [0,2,4,6,8],
    nested: {
      value: 4
    }
  },
  method(param){
    console.log(param)
  }
})

console.log(str)

/*
{
  "data":{
    "list":[0,2,4,6,8],
    "nested":{
      "value":4
    }
  },
  "method": function (param){
    console.log(param)
  }
}
*/

References

Code heavily inspired by stringified-handler


License

MIT © Marshall Brandt

About

Convert objects to strings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published