coffee-bean
Writing JSON in coffee-script format
Last updated 5 years ago by yc .
MIT · Original npm · Tarball · package.json
$ cnpm install coffee-bean 
SYNC missed versions from official npm registry.

bean

An utility to generate JSON file from a coffee-script as well as yaml.

Installation

$ npm install -g coffee-bean

Usage

$ bean [-s file.bean|file.coffee|file.yml|file.yaml]
# file.json will be generated

Motivation

Writing JSON files manually is tedious and error prone

  • Forgetting to add commas between items
  • Adding commas to the last item of an error or an object
  • Forgetting to quote the keys
  • Cannot add comments

Coffeescript's object notation is much cleaner by comparison.

A bean file is basically a coffeescript file that returns a JSON object. The object will then be formatted according to JSON rules. You can perform any legal coffeescript logic as long as the end result is a JSON object.

This is best used for managing configuration files, such as package.json. Just take a look at this module's package.bean for inspiration.

YAML is also now supported.

LICENSE

Released under MIT License.

Current Tags

  • 0.4.0                                ...           latest (5 years ago)

10 Versions

  • 0.4.0                                ...           5 years ago
  • 0.3.6                                ...           5 years ago
  • 0.3.5                                ...           5 years ago
  • 0.3.4                                ...           5 years ago
  • 0.3.3                                ...           5 years ago
  • 0.3.2                                ...           5 years ago
  • 0.3.1                                ...           5 years ago
  • 0.3.0                                ...           6 years ago
  • 0.2.0                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (5)
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |