{"name":"squeak","version":"1.3.0","description":"A tiny stream log","license":"MIT","repository":{"type":"git","url":"git+https://github.com/kevva/squeak.git"},"author":{"name":"Kevin Mårtensson","email":"kevinmartensson@gmail.com","url":"https://github.com/kevva"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["log"],"dependencies":{"chalk":"^1.0.0","console-stream":"^0.1.1","lpad-align":"^1.0.1"},"devDependencies":{"ava":"^0.0.4"},"gitHead":"5fd68a6e256015bc2bed80a89047629fb6ebfd41","bugs":{"url":"https://github.com/kevva/squeak/issues"},"homepage":"https://github.com/kevva/squeak#readme","_id":"squeak@1.3.0","_shasum":"33045037b64388b567674b84322a6521073916c3","_from":".","_npmVersion":"3.3.3","_nodeVersion":"4.1.2","_npmUser":{"name":"kevva","email":"kevinmartensson@gmail.com"},"dist":{"shasum":"33045037b64388b567674b84322a6521073916c3","tarball":"http://registry-npm.ywwl.com/squeak/download/squeak-1.3.0.tgz","integrity":"sha512-YQL1ulInM+ev8nXX7vfXsCsDh6IqXlrremc1hzi77776BtpWgYJUMto3UM05GSAaGzJgWekszjoKDrVNB5XG+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8oMHHoAb2ilINqOW68aFvyFb+ikVh0qlumAdpbp80dgIhAPkuCLMkQlb/kDMh2BGjtOclcNCyH310IquMRArpW+LB"}],"size":3017,"noattachment":false,"key":"/squeak/-/squeak-1.3.0.tgz"},"maintainers":[{"name":"kevva","email":"kevinmartensson@gmail.com"}],"directories":{},"readme":"# squeak [![Build Status](http://img.shields.io/travis/kevva/squeak.svg?style=flat)](https://travis-ci.org/kevva/squeak)\n\n> A tiny stream log\n\n![](https://cloud.githubusercontent.com/assets/709159/5165451/f0ca124e-73e4-11e4-8a49-9e278b7aff16.png)\n\n\n## Install\n\n```\n$ npm install --save squeak\n```\n\n\n## Usage\n\n```js\nvar Squeak = require('squeak');\nvar log = new Squeak()\n\t.type('info')\n\t.type('success', {color: 'green'})\n\t.type('warn', {color: 'yellow'})\n\t.type('error', {color: 'red'}, function () {\n\t\tlog.end();\n\t\tprocess.exit(1);\n\t});\n\nlog.info('this is a info message');\nlog.success('this is a success message');\nlog.warn('this is a warning');\nlog.error(new Error('this is an error').stack);\n\n/*\n     info : this is a info message\n  success : this is a success message\n     warn : this is a warning\n    error : this is an error\n    at ChildProcess.exithandler (child_process.js:648:15)\n    at ChildProcess.emit (events.js:98:17)\n */\n```\n\nYou can also customize the different types to use a custom prefix using the \n`prefix` option:\n\n```js\nvar Squeak = require('squeak');\nvar log = new Squeak({separator: ' '})\n\t.type('success', {color: 'green', prefix: '✔'})\n\t.type('warn', {color: 'yellow', prefix: '⚠'});\n\nlog.success('this is a success message');\nlog.warn('this is a warning');\n\n/*\n  ✔ this is a success message\n  ⚠ this is a warning\n */\n```\n\n\n## API\n\n### new Squeak(options)\n\nCreates a new `Squeak` instance.\n\n#### options.align\n\nType: `boolean`  \nDefault: `true`\n\nWhether to align the prefixes or not. E.g:\n\n```sh\n     foo : hello\n  foobar : world\n```\n\n#### options.indent\n\nType: `number`  \nDefault: `2`\n\nSets the indentation.\n\n#### options.separator\n\nType: `string`  \nDefault: `  :  `\n\nCustomize the separator between the `prefix` and the message.\n\n#### options.stream\n\nType: `stream`  \nDefault: `process.stderr`\n\nWhich `stream` to write to.\n\n### .write(args)\n\nType: `string`\n\nWrites to `options.stream`, using `process.stderr` by default.\n\n### .writeln(args)\n\nType: `string`\n\nSame as `.write()` but with a new line.\n\n### .writelpad(args)\n\nType: `string`\n\nSame as `.write()` but with padding.\n\n### .type(type, options, callback)\n\nAdds a type.\n\n#### type\n\nType: `string`\n\nThe name of the type. Will be used as `prefix` by default.\n\n#### options.color\n\nType: `string`\n\nSets the prefix color. Supported colors can be found [here](https://github.com/sindresorhus/ansi-styles#colors).\n\n#### options.prefix\n\nType: `string`\n\nSets the `type` prefix. Uses `type` by default.\n\n#### callback\n\nType: `function`\n\nAn optional callback to be called when the `type` is called.\n\n### .emit(event, data)\n\nEmits an event.\n\n### .end(callback)\n\nType: `function`\n\nWrites a newline and executes an optional callback function.\n\n\n## License\n\nMIT © [Kevin Mårtensson](https://github.com/kevva)\n","publish_time":1445340076945,"_cnpm_publish_time":1445340076945,"dist-tags":{"latest":"1.3.0"}}