objit
v0.1.0
Published
Object It, same as JsonIt except returns the passed object if it isn't a string
Downloads
2
Readme
ObjectIt
Same as JsonIt except returns the passed object if it isn't a string
Installation
This module is installed via npm:
npm i objit --save
For Command Line Interface:
npm i objit -g
Examples
var objit = require('objit')
objit({ op: "ok" }) // { "op": "ok" } pass-thru
objit('ok') // { "op": "ok" }
objit('ok', 'you') // { "you": "ok" }
objit('say,hello:world') // { "op": "say", "hello": "world" }
Change the default type of the inital assigned parameter
objit('ok', 'OneTime', 'DefaultType') // { "OneTime": "ok" }
objit('ok') // { "DefaultType": "ok" }
objit('ok', null, 'NewType') // { "NewType": "ok" }
Command Line Interface Examples
objit --help
Same as JsonIt except returns the passed object if it isn't a string - v0.1.0
Usage: objit JsonItString [type] [--pretty]
Examples:
objit ok
{ "op": "ok" }
objit hello say
{ "say": "hello" }
objit say,hello:world --pretty
{
"op": "say",
"hello": "world"
}
Rights
Copyright (C) 2015 by Yieme, License: MIT