bevry / cson

CoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects.
Other
1.34k stars 56 forks source link

Add `CSON.register()` which then allows to call `require('file.cson')` #5

Closed naholyr closed 12 years ago

naholyr commented 13 years ago

Usage:

var CSON = require('cson')
CSON.register() // Registers ".cson" extension
var object = require('./object.cson')

This is very similar to call CSON.parseFileSync, except that require() handles cache and it's sometimes convenient to rely on a generic API, so that you can change the backend whenever you would need it later.

naholyr commented 12 years ago

Nevermind.