String ::createCSONString(data, opts)
Source
Public: Converts an
Object into a CSON
String
data -
Object The data to convert
opts -
Object The options (options may also be forwarded onto the parser library)
:visitor -
Boolean The visitor option for `require('cson-parser').stringify` (defaults to `null`)
:indent -
Boolean The indent option for `require('cson-parser').stringify` (defaults to a single tab `'\t'`)
Returns
String or
Error
String ::createJSONString(data, opts)
Source
Public: Converts an
Object into a JSON
String
data -
Object The data to convert
opts -
Object The options (options may also be forwarded onto the parser library)
:visitor -
Boolean The visitor option for `JSON.stringify` (defaults to `null`)
:indent -
Boolean The indent option for `JSON.stringify` (defaults to two spaces ` `)
Returns
String or
Error
String ::createString(data, opts)
Source
Public: Converts an
Object into a
String of the desired format
If the format option is not specified, we default to CSON
data -
Object The data to convert
opts -
Object The options (options may also be forwarded onto the parser library)
:format -
String The format to use: "cson" (default), "json", "coffeescript", or "javascript"
:cson -
Boolean Whether or not the CSON format should be allowed (defaults to `true`)
:json -
Boolean Whether or not the JSON format should be allowed (defaults to `true`)
Returns
String or
Error
Object ::load(data, opts)
Source
Public: Parses a file path of the desired format into an
Object
If the format option is not specified, we use the filename to detect what it should be, otherwise we default to CSON
data -
String The file path to parse
opts -
Object The options (options may also be forwarded onto the parser library)
:format -
String The format to use: "cson" (default), "json", "coffeescript", or "javascript"
:cson -
Boolean Whether or not the CSON format should be allowed (defaults to `true`)
:json -
Boolean Whether or not the JSON format should be allowed (defaults to `true`)
:coffeescript -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `false`)
:json -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `json`)
Returns
Object or
Error
Object ::parse(data, opts)
Source
Public: Converts a
String of the desired format into an
Object
If the format option is not specified, we default to CSON
data -
String The string to parse
opts -
Object The options (options may also be forwarded onto the parser library)
:format -
String The format to use: "cson" (default), "json", "coffeescript", or "javascript"
:cson -
Boolean Whether or not the CSON format should be allowed (defaults to `true`)
:json -
Boolean Whether or not the JSON format should be allowed (defaults to `true`)
:coffeescript -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `false`)
:json -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `json`)
Returns
Object or
Error
Object ::parseCSFile(file, opts)
Source
Object ::parseCSONFile(file, opts)
Source
Object ::parseCSONString(data, opts)
Source
Object ::parseCSString(data, opts)
Source
Public: Parses a CoffeeScript
String into an
Object
data - The CoffeeScript
String to parse
opts -
Object The options, forwarded onto `require('coffee-scriot').eval`
Returns
Object or
Error
Object ::parseFile(data, opts)
Source
Public: Parses a file path of the desired format into an
Object
If the format option is not specified, we use the filename to detect what it should be, otherwise we default to CSON
data -
String The file path to parse
opts -
Object The options (options may also be forwarded onto the parser library)
:format -
String The format to use: "cson" (default), "json", "coffeescript", or "javascript"
:cson -
Boolean Whether or not the CSON format should be allowed (defaults to `true`)
:json -
Boolean Whether or not the JSON format should be allowed (defaults to `true`)
:coffeescript -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `false`)
:json -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `json`)
Returns
Object or
Error
Object ::parseJSFile(file, opts)
Source
Object ::parseJSONFile(file, opts)
Source
Object ::parseJSONString(data, opts)
Source
Object ::parseJSString(data, opts)
Source
Public: Parses a JavaScript
String into an
Object
data - The JavaScript
String to parse
opts -
Object The options
:content -
Object The context option that is used in `require('vm').runInNewContext`, defaults to an empty object ``
:filename -
Object The filename option that is used in `require('vm').runInNewContext`, defaults to the filename if specified
Returns
Object or
Error
Object ::parseString(data, opts)
Source
Public: Converts a
String of the desired format into an
Object
If the format option is not specified, we default to CSON
data -
String The string to parse
opts -
Object The options (options may also be forwarded onto the parser library)
:format -
String The format to use: "cson" (default), "json", "coffeescript", or "javascript"
:cson -
Boolean Whether or not the CSON format should be allowed (defaults to `true`)
:json -
Boolean Whether or not the JSON format should be allowed (defaults to `true`)
:coffeescript -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `false`)
:json -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `json`)
Returns
Object or
Error
Object ::require(data, opts)
Source
Public: Requires or parses a file path of the desired format into an
Object
If the format option is not specified, we use the filename to detect what it should be, otherwise we default to CSON
data -
String The file path to require or parse
opts -
Object The options (options may also be forwarded onto the parser library)
:format -
String The format to use: "cson" (default), "json", "coffeescript", or "javascript"
:cson -
Boolean Whether or not the CSON format should be allowed (defaults to `true`)
:json -
Boolean Whether or not the JSON format should be allowed (defaults to `true`)
:coffeescript -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `false`)
:json -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `json`)
Returns
Object or
Error
Object ::requireCSFile(file, opts)
Source
Public: Requires a CoffeeScript file and returns the result
Object
data -
String The file path to require
opts -
Object The options, unused
Returns
Object or
Error
Object ::requireCSONFile(file, opts)
Source
Object ::requireFile(data, opts)
Source
Public: Requires or parses a file path of the desired format into an
Object
If the format option is not specified, we use the filename to detect what it should be, otherwise we default to CSON
data -
String The file path to require or parse
opts -
Object The options (options may also be forwarded onto the parser library)
:format -
String The format to use: "cson" (default), "json", "coffeescript", or "javascript"
:cson -
Boolean Whether or not the CSON format should be allowed (defaults to `true`)
:json -
Boolean Whether or not the JSON format should be allowed (defaults to `true`)
:coffeescript -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `false`)
:json -
Boolean Whether or not the CoffeeScript format should be allowed (defaults to `json`)
Returns
Object or
Error
Object ::requireJSFile(file, opts)
Source
Public: Requires a JavaScript file and returns the result
Object
data -
String The file path to require
opts -
Object The options, unused
Returns
Object or
Error
Object ::requireJSONFile(file, opts)
Source
String ::stringify(data, opts)
Source
Public: Converts an
Object into a
String of the desired format
If the format option is not specified, we default to CSON
data -
Object The data to convert
opts -
Object The options (options may also be forwarded onto the parser library)
:format -
String The format to use: "cson" (default), "json", "coffeescript", or "javascript"
:cson -
Boolean Whether or not the CSON format should be allowed (defaults to `true`)
:json -
Boolean Whether or not the JSON format should be allowed (defaults to `true`)
Returns
String or
Error