{"_id":"tokenizer","_rev":"31-519f211d7a60ed9835202f55e2aa897b","name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","dist-tags":{"latest":"1.1.2"},"versions":{"0.0.1-2-g5805b9e":{"name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","version":"0.0.1-2-g5805b9e","homepage":"http://github.com/floby/node-tokenizer","repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"main":"lib/Tokenizer.js","directories":{"lib":"lib"},"engines":{"node":"*"},"_id":"tokenizer@0.0.1-2-g5805b9e","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.5","dist":{"shasum":"e3175cf8cdac9f239f6ee2088258a25b9aeafccc","tarball":"https://registry.npmjs.org/tokenizer/-/tokenizer-0.0.1-2-g5805b9e.tgz","integrity":"sha512-Ip4tyRmfpnBL6aPU7KOdXimrI9NcD2xvhpJsFolUcHCMsUuC3f1FYhT0pt1P8Qkx0pffPU9Ifk6I6fkjfsKkug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICXveRQvQg9YWBKmxz9DCPWOo7z4zq23WBwrdHtswG1GAiEA/XVKqfU7QngIKdhv0RrJKrEO++u8nqKwTxF13IjWkG4="}]}},"0.1.0":{"name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","version":"0.1.0","homepage":"http://github.com/floby/node-tokenizer","repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"main":"lib/Tokenizer.js","directories":{"lib":"lib"},"engines":{"node":"*"},"_id":"tokenizer@0.1.0","_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.5","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"40d71b9ae9729b8b32070466ac1d3920c7abad29","tarball":"https://registry.npmjs.org/tokenizer/-/tokenizer-0.1.0.tgz","integrity":"sha512-AdGT3w9DLrBa767o+gXgNuEHeRUcCuKnjLv6nlkM60TAzdT0HqZuDMVBGtqIybeOA62YLLV7/7g2+DHRr1fvjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVQcDYpizBQK+p7kbfwW8C3BmcPAeG43k5KR6Qo+d2sgIhAPJCrwikLYpuLvn++oSnYigKT3j9cQSfUO5uL5ZvKH5x"}]}},"0.1.1":{"name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","version":"0.1.1","homepage":"http://github.com/floby/node-tokenizer","repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"main":"lib/Tokenizer.js","directories":{"lib":"lib"},"engines":{"node":"~0.4 ~0.5 ~0.6 ~0.7 ~0.8 ~0.9"},"readme":"# Synopsis\nA wide purpose tokenizer for JavaScript. The interface follows more or less\nthe WriteStream from [node.js](http://nodejs.org).\n\nnode-tokenizer is published on npm so you can install it with `npm install tokenizer`\n\n## How to\n\n* require the Tokenizer constructor\n\n``` javascript\nvar Tokenizer = require('tokenizer');\n```\n\n* construct one (we'll see what the callback is used for)\n\n``` javascript\nvar t = new Tokenizer(mycallback);\n``` \n\n* add rules\n\n``` javascript\nt.addRule(/^my regex$/, 'type');\n```\n\n* write or pump to it\n\n``` javascript\nt.write(data);\n// or\nstream.pipe(t);\n```\n\n* listen for new tokens\n\n``` javascript\nt.on('token', function(token, type) {\n    // do something useful\n    // type is the type of the token (specified with addRule)\n    // token is the actual matching string\n})\n// alternatively you can listen on the 'data' event\n```\n\n* look out for the end\n\n``` javascript\nt.on('end', callback);\n```\n\nthe optional callback argument for the constructor is a function that will\nbe called for each token in order to specify a different type by returning\na string. The parameters passed to the function are token(the token that we found)\nand match, an object like this \n\n``` javascript\n{\n    regex: /whatever/ // the regex that matched the token\n    type: 'type' // the type of the token\n}\n```\n\nHave a look in the example folder\n\n## Rules\nrules are regular expressions associated with a type name.\nThe tokenizer tries to find the longest string matching one or more rules.\nWhen several rules match the same string, priority is given to the rule\nwhich was added first. (this may change)\n\nPlease note that your regular expressions should use ^ and $ in order\nto test the whole string. If these are not used, you rule will match _every_\nstring that contains what you specified, this could be the whole file!\n\n## To do\n* a lot of optimisation\n* being able to share rules across several tokenizers\n    (although this can be achieved through inheritance)\n* probably more hooks\n* more checking\n","_id":"tokenizer@0.1.1","dist":{"shasum":"6a288fbbfa841ea442e06df01d076ded7eed1597","tarball":"https://registry.npmjs.org/tokenizer/-/tokenizer-0.1.1.tgz","integrity":"sha512-fqjFAt5DryGclYDM5/me1VoSBFqs99bX/qLgywClpYmVEslX+R21NjE+x3do9L3ISHUasOkCSnwF1qONp/2Hdw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICDKmNX5IqMv3NxTSOIMZyFIv8t16VASZja9tWXziOM4AiADwsZ7x3l7GnzjNGKHnbmYRr2/nXL0Gmwm6Hgj+X8/+A=="}]},"maintainers":[{"name":"floby","email":"florent.jaby@gmail.com"}]},"0.1.2":{"name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","version":"0.1.2","homepage":"http://github.com/floby/node-tokenizer","repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"main":"lib/Tokenizer.js","directories":{"lib":"lib"},"engines":{"node":"~0.4 ~0.5 ~0.6 ~0.7 ~0.8 ~0.9"},"readme":"# Synopsis\nA wide purpose tokenizer for JavaScript. The interface follows more or less\nthe WriteStream from [node.js](http://nodejs.org).\n\nnode-tokenizer is published on npm so you can install it with `npm install tokenizer`\n\n## How to\n\n* require the Tokenizer constructor\n\n``` javascript\nvar Tokenizer = require('tokenizer');\n```\n\n* construct one (we'll see what the callback is used for)\n\n``` javascript\nvar t = new Tokenizer(mycallback);\n``` \n\n* add rules\n\n``` javascript\nt.addRule(/^my regex$/, 'type');\n```\n\n* write or pump to it\n\n``` javascript\nt.write(data);\n// or\nstream.pipe(t);\n```\n\n* listen for new tokens\n\n``` javascript\nt.on('token', function(token, type) {\n    // do something useful\n    // type is the type of the token (specified with addRule)\n    // token is the actual matching string\n})\n// alternatively you can listen on the 'data' event\n```\n\n* look out for the end\n\n``` javascript\nt.on('end', callback);\n```\n\nthe optional callback argument for the constructor is a function that will\nbe called for each token in order to specify a different type by returning\na string. The parameters passed to the function are token(the token that we found)\nand match, an object like this \n\n``` javascript\n{\n    regex: /whatever/ // the regex that matched the token\n    type: 'type' // the type of the token\n}\n```\n\nHave a look in the example folder\n\n## Rules\nrules are regular expressions associated with a type name.\nThe tokenizer tries to find the longest string matching one or more rules.\nWhen several rules match the same string, priority is given to the rule\nwhich was added first. (this may change)\n\nPlease note that your regular expressions should use ^ and $ in order\nto test the whole string. If these are not used, you rule will match _every_\nstring that contains what you specified, this could be the whole file!\n\n## To do\n* a lot of optimisation\n* being able to share rules across several tokenizers\n    (although this can be achieved through inheritance)\n* probably more hooks\n* more checking\n","readmeFilename":"README.md","_id":"tokenizer@0.1.2","dist":{"shasum":"509c563ee36abdfa86ba8ec4836ffd774b8b52da","tarball":"https://registry.npmjs.org/tokenizer/-/tokenizer-0.1.2.tgz","integrity":"sha512-VNF+CWh0PfBEKpIGeTzTV8ClF1CRxCC8vkmaXcLQpv27V2HCylbmYL4dHcomgB6q5I9+3fMNB6S91QXqOa+fOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRthTyZaKMEgJjNhegiD+H3ITUyaAVbb5aCy6IPymPSAIhAIInCc42bPCoKBPJ5E9GG6dcy3NmkrFlFcKtXPNhDPrd"}]},"_npmVersion":"1.1.66","_npmUser":{"name":"floby","email":"florent.jaby@gmail.com"},"maintainers":[{"name":"floby","email":"florent.jaby@gmail.com"}]},"0.1.3":{"name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","version":"0.1.3","homepage":"http://github.com/floby/node-tokenizer","repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"main":"lib/Tokenizer.js","directories":{"lib":"lib"},"engines":{"node":"~0.4 ~0.5 ~0.6 ~0.7 ~0.8 ~0.9"},"readme":"# Synopsis\nA wide purpose tokenizer for JavaScript. The interface follows more or less\nthe WriteStream from [node.js](http://nodejs.org).\n\nnode-tokenizer is published on npm so you can install it with `npm install tokenizer`\n\n## How to\n\n* require the Tokenizer constructor\n\n``` javascript\nvar Tokenizer = require('tokenizer');\n```\n\n* construct one (we'll see what the callback is used for)\n\n``` javascript\nvar t = new Tokenizer(mycallback);\n``` \n\n* add rules\n\n``` javascript\nt.addRule(/^my regex$/, 'type');\n```\n\n* write or pump to it\n\n``` javascript\nt.write(data);\n// or\nstream.pipe(t);\n```\n\n* listen for new tokens\n\n``` javascript\nt.on('token', function(token, type) {\n    // do something useful\n    // type is the type of the token (specified with addRule)\n    // token is the actual matching string\n})\n// alternatively you can listen on the 'data' event\n```\n\n* look out for the end\n\n``` javascript\nt.on('end', callback);\n```\n\nthe optional callback argument for the constructor is a function that will\nbe called for each token in order to specify a different type by returning\na string. The parameters passed to the function are token(the token that we found)\nand match, an object like this \n\n``` javascript\n{\n    regex: /whatever/ // the regex that matched the token\n    type: 'type' // the type of the token\n}\n```\n\nHave a look in the example folder\n\n## Rules\nrules are regular expressions associated with a type name.\nThe tokenizer tries to find the longest string matching one or more rules.\nWhen several rules match the same string, priority is given to the rule\nwhich was added first. (this may change)\n\nPlease note that your regular expressions should use ^ and $ in order\nto test the whole string. If these are not used, you rule will match _every_\nstring that contains what you specified, this could be the whole file!\n\n## To do\n* a lot of optimisation\n* being able to share rules across several tokenizers\n    (although this can be achieved through inheritance)\n* probably more hooks\n* more checking\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2012 Florent Jaby\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"tokenizer@0.1.3","dist":{"shasum":"5c3a95dbde7234bf3c0f90536af775e890343e48","tarball":"https://registry.npmjs.org/tokenizer/-/tokenizer-0.1.3.tgz","integrity":"sha512-/Zv4+ayF4QNYiZBn5vKu8OEdfreOg02pV4/DuVZN6+8Dd4HyP3/5zYdwd3a/3JwIyhtyH8IB9OP+Ha7LoWaQ7w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAMo7KJFoD/45WB/u30zTRIAE/ic/w8JimMq8q3PUeiRAiA3CHXxgHD9VU+59yLPBt0P70SKvemNB6uBGpDuDxbTXg=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"floby","email":"florent.jaby@gmail.com"},"maintainers":[{"name":"floby","email":"florent.jaby@gmail.com"}]},"0.1.4":{"name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","version":"0.1.4","homepage":"http://github.com/floby/node-tokenizer","repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"main":"lib/Tokenizer.js","scripts":{"test":"nodeunit test/test-*.js"},"directories":{"lib":"lib"},"engines":{"node":"~0.4 ~0.5 ~0.6 ~0.7 ~0.8 ~0.9"},"readme":"# Synopsis\nA wide purpose tokenizer for JavaScript. The interface follows more or less\nthe WriteStream from [node.js](http://nodejs.org).\n\nnode-tokenizer is published on npm so you can install it with `npm install tokenizer`\n\n## How to\n\n* require the Tokenizer constructor\n\n``` javascript\nvar Tokenizer = require('tokenizer');\n```\n\n* construct one (we'll see what the callback is used for)\n\n``` javascript\nvar t = new Tokenizer(mycallback);\n``` \n\n* add rules\n\n``` javascript\nt.addRule(/^my regex$/, 'type');\n```\n\n* write or pump to it\n\n``` javascript\nt.write(data);\n// or\nstream.pipe(t);\n```\n\n* listen for new tokens\n\n``` javascript\nt.on('token', function(token, type) {\n    // do something useful\n    // type is the type of the token (specified with addRule)\n    // token is the actual matching string\n})\n// alternatively you can listen on the 'data' event\n```\n\n* look out for the end\n\n``` javascript\nt.on('end', callback);\n```\n\nthe optional callback argument for the constructor is a function that will\nbe called for each token in order to specify a different type by returning\na string. The parameters passed to the function are token(the token that we found)\nand match, an object like this \n\n``` javascript\n{\n    regex: /whatever/ // the regex that matched the token\n    type: 'type' // the type of the token\n}\n```\n\nHave a look in the example folder\n\n## Rules\nrules are regular expressions associated with a type name.\nThe tokenizer tries to find the longest string matching one or more rules.\nWhen several rules match the same string, priority is given to the rule\nwhich was added first. (this may change)\n\nPlease note that your regular expressions should use ^ and $ in order\nto test the whole string. If these are not used, you rule will match _every_\nstring that contains what you specified, this could be the whole file!\n\n## To do\n* a lot of optimisation\n* being able to share rules across several tokenizers\n    (although this can be achieved through inheritance)\n* probably more hooks\n* more checking\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2012 Florent Jaby\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Floby/node-tokenizer/issues"},"_id":"tokenizer@0.1.4","dist":{"shasum":"f0763453eb935dfcbdf152e2367c19bcbe8b0203","tarball":"https://registry.npmjs.org/tokenizer/-/tokenizer-0.1.4.tgz","integrity":"sha512-NEv7CBRIyNMsDUCHwfZVRvfRBAXelop2w73AXtwRduVftpDqK6PSOFBO3ZLyULObQkooJz7zMn8GUD8f+8C+HQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbBaa3Xx8OnYPu/J8ROw1FGbca2AWbB0jXAHqrO3+caQIgaN+EvU/tGOOVOzIX3Gbh4UGz/AIAyY3IUQYVjzpuUdY="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"floby","email":"florent.jaby@gmail.com"},"maintainers":[{"name":"floby","email":"florent.jaby@gmail.com"}]},"1.0.0":{"name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","version":"1.0.0","homepage":"http://github.com/floby/node-tokenizer","repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"main":"lib/Tokenizer.js","scripts":{"test":"nodeunit test/test-*.js"},"directories":{"lib":"lib"},"engines":{"node":"~0.4 ~0.5 ~0.6 ~0.7 ~0.8 ~0.9"},"readme":"# Synopsis\nA wide purpose tokenizer for JavaScript. The interface follows more or less\nthe WriteStream from [node.js](http://nodejs.org).\n\nnode-tokenizer is published on npm so you can install it with `npm install tokenizer`\n\n## How to\n\n* require the Tokenizer constructor\n\n``` javascript\nvar Tokenizer = require('tokenizer');\n```\n\n* construct one (we'll see what the callback is used for)\n\n``` javascript\nvar t = new Tokenizer(mycallback);\n``` \n\n* add rules\n\n``` javascript\nt.addRule(/^my regex$/, 'type');\n```\n\n* write or pump to it\n\n``` javascript\nt.write(data);\n// or\nstream.pipe(t);\n```\n\n* listen for new tokens\n\n``` javascript\nt.on('token', function(token, type) {\n    // do something useful\n    // type is the type of the token (specified with addRule)\n    // token is the actual matching string\n})\n// alternatively you can listen on the 'data' event\n```\n\n* look out for the end\n\n``` javascript\nt.on('end', callback);\n```\n\nthe optional callback argument for the constructor is a function that will\nbe called for each token in order to specify a different type by returning\na string. The parameters passed to the function are token(the token that we found)\nand match, an object like this \n\n``` javascript\n{\n    regex: /whatever/ // the regex that matched the token\n    type: 'type' // the type of the token\n}\n```\n\nHave a look in the example folder\n\n## Rules\nrules are regular expressions associated with a type name.\nThe tokenizer tries to find the longest string matching one or more rules.\nWhen several rules match the same string, priority is given to the rule\nwhich was added first. (this may change)\n\nPlease note that your regular expressions should use ^ and $ in order\nto test the whole string. If these are not used, you rule will match _every_\nstring that contains what you specified, this could be the whole file!\n\n## To do\n* a lot of optimisation\n* being able to share rules across several tokenizers\n    (although this can be achieved through inheritance)\n* probably more hooks\n* more checking\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2012 Florent Jaby\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Floby/node-tokenizer/issues"},"_id":"tokenizer@1.0.0","dist":{"shasum":"3fd8a86f143cdc9e0222c514d4d2ce254c512cc7","tarball":"https://registry.npmjs.org/tokenizer/-/tokenizer-1.0.0.tgz","integrity":"sha512-PVryENf3TSbyFI8Ln6T2MZkTtncRcED8YT2MeJuDy1Y1dReSwRZ/T496UVdZFO3ahdmCZcVrbvzXhsb92mRIMQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF3KpvZkkYK1TgO4qVAJgBYMOit6GoyAitCOdIkDY4L9AiEArhV7KTH2qxfV+12PChRqSYGjzlwrimP2K0SvoehqQ9w="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"floby","email":"florent.jaby@gmail.com"},"maintainers":[{"name":"floby","email":"florent.jaby@gmail.com"}]},"1.0.1":{"name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","version":"1.0.1","homepage":"http://github.com/floby/node-tokenizer","repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"main":"lib/Tokenizer.js","scripts":{"test":"nodeunit test/test-*.js"},"directories":{"lib":"lib"},"engines":{"node":"0.10.x"},"readme":"# Synopsis\nA wide purpose tokenizer for JavaScript. The interface follows more or less\nthe WriteStream from [node.js](http://nodejs.org).\n\nnode-tokenizer is published on npm so you can install it with `npm install tokenizer`\n\n## How to\n\n* require the Tokenizer constructor\n\n``` javascript\nvar Tokenizer = require('tokenizer');\n```\n\n* construct one (we'll see what the callback is used for)\n\n``` javascript\nvar t = new Tokenizer(mycallback);\n``` \n\n* add rules\n\n``` javascript\nt.addRule(/^my regex$/, 'type');\n```\n\n* write or pump to it\n\n``` javascript\nt.write(data);\n// or\nstream.pipe(t);\n```\n\n* listen for new tokens\n\n``` javascript\nt.on('token', function(token, type) {\n    // do something useful\n    // type is the type of the token (specified with addRule)\n    // token is the actual matching string\n})\n// alternatively you can listen on the 'data' event\n```\n\n* look out for the end\n\n``` javascript\nt.on('end', callback);\n```\n\nthe optional callback argument for the constructor is a function that will\nbe called for each token in order to specify a different type by returning\na string. The parameters passed to the function are token(the token that we found)\nand match, an object like this \n\n``` javascript\n{\n    regex: /whatever/ // the regex that matched the token\n    type: 'type' // the type of the token\n}\n```\n\nHave a look in the example folder\n\n## Rules\nrules are regular expressions associated with a type name.\nThe tokenizer tries to find the longest string matching one or more rules.\nWhen several rules match the same string, priority is given to the rule\nwhich was added first. (this may change)\n\nPlease note that your regular expressions should use ^ and $ in order\nto test the whole string. If these are not used, you rule will match _every_\nstring that contains what you specified, this could be the whole file!\n\n## To do\n* a lot of optimisation\n* being able to share rules across several tokenizers\n    (although this can be achieved through inheritance)\n* probably more hooks\n* more checking\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2012 Florent Jaby\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Floby/node-tokenizer/issues"},"_id":"tokenizer@1.0.1","dist":{"shasum":"ee45e7ab3fdd3d185a204bfd8f0bf49fb014e1a5","tarball":"https://registry.npmjs.org/tokenizer/-/tokenizer-1.0.1.tgz","integrity":"sha512-kMpOXoZ0B/oxGJBCQo/fLUKtCtWlqN9uSc83+TZ0cN+Df2F7oFwyOVyqc/9V5hV35z1i8N7tvTRXSKjiETjDdA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNqVk1uCdre/6LJslIuCZbypr1ncbY1Z6KIaTsd376OAIhALEy25bmUCeK71mG9n5HP3uF3NBEz1q9wN7URZre7dHN"}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"floby","email":"florent.jaby@gmail.com"},"maintainers":[{"name":"floby","email":"florent.jaby@gmail.com"}]},"1.1.0":{"name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","version":"1.1.0","homepage":"http://github.com/floby/node-tokenizer","repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"main":"lib/Tokenizer.js","scripts":{"test":"nodeunit test/test-*.js"},"directories":{"lib":"lib"},"engines":{"node":"0.10.x"},"devDependencies":{"nodeunit":"~0.8.1"},"dependencies":{"disect":"~1.1.0"},"readme":"[![Build Status](https://travis-ci.org/Floby/node-tokenizer.png)](https://travis-ci.org/Floby/node-tokenizer)\n\n# Synopsis\nA wide purpose tokenizer for JavaScript. The interface follows more or less\nthe WriteStream from [node.js](http://nodejs.org).\n\nnode-tokenizer is published on npm so you can install it with `npm install tokenizer`\n\n## How to\n\n* require the Tokenizer constructor\n\n``` javascript\nvar Tokenizer = require('tokenizer');\n```\n\n* construct one (we'll see what the callback is used for)\n\n``` javascript\nvar t = new Tokenizer(mycallback);\n``` \n\n* add rules\n\n``` javascript\nt.addRule(/^my regex$/, 'type');\n```\n\n* write or pump to it\n\n``` javascript\nt.write(data);\n// or\nstream.pipe(t);\n```\n\n* listen for new tokens\n\n``` javascript\nt.on('token', function(token, type) {\n    // do something useful\n    // type is the type of the token (specified with addRule)\n    // token is the actual matching string\n})\n// alternatively you can listen on the 'data' event\n```\n\n* look out for the end\n\n``` javascript\nt.on('end', callback);\n```\n\nthe optional callback argument for the constructor is a function that will\nbe called for each token in order to specify a different type by returning\na string. The parameters passed to the function are token(the token that we found)\nand match, an object like this \n\n``` javascript\n{\n    regex: /whatever/ // the regex that matched the token\n    type: 'type' // the type of the token\n}\n```\n\nHave a look in the example folder\n\n## Rules\nrules are regular expressions associated with a type name.\nThe tokenizer tries to find the longest string matching one or more rules.\nWhen several rules match the same string, priority is given to the rule\nwhich was added first. (this may change)\n\nPlease note that your regular expressions should use ^ and $ in order\nto test the whole string. If these are not used, you rule will match _every_\nstring that contains what you specified, this could be the whole file!\n\n## To do\n* a lot of optimisation\n* being able to share rules across several tokenizers\n    (although this can be achieved through inheritance)\n* probably more hooks\n* more checking\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2012 Florent Jaby\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Floby/node-tokenizer/issues"},"_id":"tokenizer@1.1.0","dist":{"shasum":"e74c2e92ba234363e98197adc8a99003911c6d95","tarball":"https://registry.npmjs.org/tokenizer/-/tokenizer-1.1.0.tgz","integrity":"sha512-lZejJO0sAShV0CUlbCT2SNBEvI/yPIwQfGFc6hgYWaUaRHjd19JIJPCyxfM2S1NPsgwPqKsOC5dqIiHWvVEv5A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8mP1BVSH9XcGHB+9Nu7Va6ybkz83qANYlsSjnvC1b2gIgOJJb/cHjwXwZdQrc3EO0E/Zp0RxLnrG55w+yqwZP1CU="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"floby","email":"florent.jaby@gmail.com"},"maintainers":[{"name":"floby","email":"florent.jaby@gmail.com"}]},"1.1.1":{"name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","version":"1.1.1","homepage":"http://github.com/floby/node-tokenizer","repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"main":"lib/Tokenizer.js","scripts":{"test":"nodeunit test/test-*.js"},"directories":{"lib":"lib"},"engines":{"node":"0.10.x"},"devDependencies":{"nodeunit":"~0.8.1"},"dependencies":{"disect":"~1.1.0"},"readme":"[![Build Status](https://travis-ci.org/Floby/node-tokenizer.png)](https://travis-ci.org/Floby/node-tokenizer)\n\n# Synopsis\nA wide purpose tokenizer for JavaScript. The interface follows more or less\nthe WriteStream from [node.js](http://nodejs.org).\n\nnode-tokenizer is published on npm so you can install it with `npm install tokenizer`\n\n## How to\n\n* require the Tokenizer constructor\n\n``` javascript\nvar Tokenizer = require('tokenizer');\n```\n\n* construct one (we'll see what the callback is used for)\n\n``` javascript\nvar t = new Tokenizer(mycallback);\n``` \n\n* add rules\n\n``` javascript\nt.addRule(/^my regex$/, 'type');\n```\n\n* write or pump to it\n\n``` javascript\nt.write(data);\n// or\nstream.pipe(t);\n```\n\n* listen for new tokens\n\n``` javascript\nt.on('token', function(token, type) {\n    // do something useful\n    // type is the type of the token (specified with addRule)\n    // token is the actual matching string\n})\n// alternatively you can listen on the 'data' event\n```\n\n* look out for the end\n\n``` javascript\nt.on('end', callback);\n```\n\nthe optional callback argument for the constructor is a function that will\nbe called for each token in order to specify a different type by returning\na string. The parameters passed to the function are token(the token that we found)\nand match, an object like this \n\n``` javascript\n{\n    regex: /whatever/ // the regex that matched the token\n    type: 'type' // the type of the token\n}\n```\n\nHave a look in the example folder\n\n## Rules\nrules are regular expressions associated with a type name.\nThe tokenizer tries to find the longest string matching one or more rules.\nWhen several rules match the same string, priority is given to the rule\nwhich was added first. (this may change)\n\nPlease note that your regular expressions should use ^ and $ in order\nto test the whole string. If these are not used, you rule will match _every_\nstring that contains what you specified, this could be the whole file!\n\n## To do\n* a lot of optimisation\n* being able to share rules across several tokenizers\n    (although this can be achieved through inheritance)\n* probably more hooks\n* more checking\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2012 Florent Jaby\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Floby/node-tokenizer/issues"},"_id":"tokenizer@1.1.1","dist":{"shasum":"027f32148644eff7a1ceb76c543811b72d7a6135","tarball":"https://registry.npmjs.org/tokenizer/-/tokenizer-1.1.1.tgz","integrity":"sha512-zBVsR5wFsWswzgf/WYpaPqANB8hHsblsmwPwGyYsljcHnt4SVqLvpNEDeQwi2ULWXiGXPImbKMDSsN3Lt/bSGQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAj1xGDfNS+EEctRZtiIDjj6WewIlpvf1jBn+LIhAQ5EAiAJCyWIZyee/iz0LlUKqFjiTbJaIRQ5e2moZUb0e9zBRg=="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"floby","email":"florent.jaby@gmail.com"},"maintainers":[{"name":"floby","email":"florent.jaby@gmail.com"}]},"1.1.2":{"name":"tokenizer","description":"A wide purpose tokenizer for node.js which looks like a stream","version":"1.1.2","homepage":"http://github.com/floby/node-tokenizer","repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"main":"lib/Tokenizer.js","scripts":{"test":"nodeunit test/test-*.js"},"directories":{"lib":"lib"},"engines":{"node":"0.10.x"},"devDependencies":{"nodeunit":"~0.8.1"},"dependencies":{"disect":"~1.1.0"},"readme":"[![Build Status](https://travis-ci.org/Floby/node-tokenizer.png)](https://travis-ci.org/Floby/node-tokenizer)\n\n# Synopsis\nA wide purpose tokenizer for JavaScript. The interface follows more or less\nthe WriteStream from [node.js](http://nodejs.org).\n\nnode-tokenizer is published on npm so you can install it with `npm install tokenizer`\n\n## How to\n\n* require the Tokenizer constructor\n\n``` javascript\nvar Tokenizer = require('tokenizer');\n```\n\n* construct one (we'll see what the callback is used for)\n\n``` javascript\nvar t = new Tokenizer(mycallback);\n``` \n\n* add rules\n\n``` javascript\nt.addRule(/^my regex$/, 'type');\n```\n\n* write or pump to it\n\n``` javascript\nt.write(data);\n// or\nstream.pipe(t);\n```\n\n* listen for new tokens\n\n``` javascript\nt.on('token', function(token, type) {\n    // do something useful\n    // type is the type of the token (specified with addRule)\n    // token is the actual matching string\n})\n// alternatively you can use the tokenizer as a readable stream.\n```\n\n* look out for the end\n\n``` javascript\nt.on('end', callback);\n```\n\nthe optional callback argument for the constructor is a function that will\nbe called for each token in order to specify a different type by returning\na string. The parameters passed to the function are token(the token that we found)\nand match, an object like this \n\n``` javascript\n{\n    regex: /whatever/ // the regex that matched the token\n    type: 'type' // the type of the token\n}\n```\n\nHave a look in the example folder\n\n## Rules\nrules are regular expressions associated with a type name.\nThe tokenizer tries to find the longest string matching one or more rules.\nWhen several rules match the same string, priority is given to the rule\nwhich was added first. (this may change)\n\nPlease note that your regular expressions should use ^ and $ in order\nto test the whole string. If these are not used, you rule will match _every_\nstring that contains what you specified, this could be the whole file!\n\n## To do\n* a lot of optimisation\n* being able to share rules across several tokenizers\n    (although this can be achieved through inheritance)\n* probably more hooks\n* more checking\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2012 Florent Jaby\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/Floby/node-tokenizer/issues"},"_id":"tokenizer@1.1.2","dist":{"shasum":"0058bdc229affaed05b29333675ccf53eae34f5d","tarball":"https://registry.npmjs.org/tokenizer/-/tokenizer-1.1.2.tgz","integrity":"sha512-c/EYsBwEW/EX28q44UaSrJ9o5M2aI+N/xdJJ4Zl7dNq76OmWQHhmXH0T8DJQNjVYPc7NclV2CZQfyeUMfnEu/A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMkmhiJcoAC8euOXGlRhLHJZOB3L4QpASjHCDd47vzmAiBELVnKnH1Jr60sLRF48Chpog9B3NB37HRjLJQuKzY4nA=="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"floby","email":"florent.jaby@gmail.com"},"maintainers":[{"name":"floby","email":"florent.jaby@gmail.com"}]}},"maintainers":[{"name":"floby","email":"florent.jaby@gmail.com"}],"time":{"modified":"2022-06-27T18:05:08.522Z","created":"2011-04-10T20:45:58.548Z","0.0.1-2-g5805b9e":"2011-04-10T20:45:59.122Z","0.1.0":"2011-04-15T20:37:29.311Z","0.1.1":"2012-08-05T12:27:52.794Z","0.1.2":"2013-02-14T10:15:03.724Z","0.1.3":"2013-05-24T08:05:58.775Z","0.1.4":"2013-07-05T12:52:10.517Z","1.0.0":"2013-07-05T13:42:27.977Z","1.0.1":"2013-07-05T13:46:58.339Z","1.1.0":"2013-07-06T18:23:37.863Z","1.1.1":"2013-07-11T22:58:09.144Z","1.1.2":"2013-07-11T23:02:34.570Z"},"author":{"name":"Florent Jaby","email":"florent.jaby@gmail.com"},"repository":{"type":"git","url":"git://github.com/Floby/node-tokenizer.git"},"users":{"yvesm":true,"joshjung":true,"markscripter":true,"ahsanshafiq":true,"danpolitte":true,"sbekrin":true}}