{"_id":"cstep","_rev":"117982","name":"cstep","description":"Usage","dist-tags":{"latest":"0.0.1"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"time":{"modified":"2021-06-03T10:52:22.000Z","created":"2013-01-25T19:38:04.984Z","0.0.1":"2013-04-02T01:59:00.214Z","0.0.0":"2013-01-25T19:38:04.984Z"},"users":{},"author":"","repository":{"type":"git","url":"git://github.com/crcn/coffee-step.git"},"versions":{"0.0.1":{"name":"cstep","version":"0.0.1","description":"Usage","main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/crcn/coffee-step.git"},"author":"","license":"BSD","readmeFilename":"README.md","dependencies":{"tq":"0.2.x"},"_id":"cstep@0.0.1","dist":{"shasum":"24f5224f15f494da9d0cdd1647597e594ba38c00","size":2678,"noattachment":false,"key":"/cstep/-/cstep-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/cstep/download/cstep-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"directories":{},"publish_time":1364867940214,"_cnpm_publish_time":1364867940214,"_hasShrinkwrap":false},"0.0.0":{"name":"cstep","version":"0.0.0","description":"Usage","main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/crcn/coffee-step.git"},"author":"","license":"BSD","readmeFilename":"README.md","dependencies":{"tq":"0.0.x"},"_id":"cstep@0.0.0","dist":{"shasum":"eb5f1ca40b787278ea654907d391ad48db24b44c","size":2500,"noattachment":false,"key":"/cstep/-/cstep-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cstep/download/cstep-0.0.0.tgz"},"_npmVersion":"1.1.66","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"directories":{},"publish_time":1359142684984,"_cnpm_publish_time":1359142684984,"_hasShrinkwrap":false}},"readme":"Flow-control library used for coffeescript classes\n\nUsage\n\n```coffeescript\ncstep = require \"cstep\"\n\nclass Config\n  \n  ###\n    Function: Constructor\n\n    Parameters:\n      source - source of the configuration file\n\n  ###\n\n  constructor: (@source) ->\n\n  ###\n    Function: load\n\n    Loads the configuration file\n\n    Parameters:\n\n    next - called when load is complete\n  ###\n\n  load: cstep (next) ->\n    fs.readFile @source, (err, content) =>\n      @_content = JSON.parse content\n      next()\n\n  ###\n    Function: set\n\n    sets a value to the configuration file\n\n    Parameters:\n\n    next - called when set is complete (used mostly for cstep)\n  ###\n\n  set: cstep (key, value, next) ->\n    @_content[key] = value\n    next()\n\n  ###\n    Function: save\n\n    Parameters:\n\n    next - called when save is complete\n  ###\n\n  save: cstep (next) ->\n    fs.writeFile @source, JSON.stringify(@_content), next\n```\n\n\nUsing Config.coffee\n\n```coffeescript\nconfig = new Config __dirname + \"/config.json\"\nconfig.load().set(\"hello\", \"world\").save () ->\n  #successfully saved {\"hello\":\"world\"}\n```\n\n\n","_attachments":{},"readmeFilename":"README.md","license":"BSD"}