coffee-son

0.0.0 • Public • Published

CoffeeSON

Goals:

  • A description of how to format JSON data as literals in CoffeeScript. (started)
  • A tool for rendering JSON data as CoffeeScript for inclusion in CoffeeScript files. (just started)

Note: This is not intended as a replacement for JSON, but a tool for using it with CoffeeScript. It's not a serialization format, it's an editing format. Note the inclusion of module.exports (a replacement format would include a parser).

Example

CoffeeScript module with a literal:

module.exports =
  spans:
    [
      text: ''
    ,
      text: 'link'
      url: 'https://github.com/jsonista/coffee-literals'
    ,
      text: ' to this repo'
    ]
  mustache:
    '''
    <div>
    {{ spans }}
    </div>
    '''

JSON:

{
  "spans":
  [
    {
      "text": ""
    },
    {
      "text": "link",
      "url": "https://github.com/jsonista/coffee-literals"
    },
    {
      "text": " to this repo"
    }
  ],
  "mustache": "<div>\n{{ spans }}\n</div>"
}

/coffee-son/

    Package Sidebar

    Install

    npm i coffee-son

    Weekly Downloads

    1

    Version

    0.0.0

    License

    none

    Last publish

    Collaborators

    • bat-archive