{"name":"snapdragon-token","description":"Create a snapdragon token. Used by the snapdragon lexer, but can also be used by plugins.","version":"2.0.0","homepage":"https://github.com/here-be-snapdragons/snapdragon-token","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/here-be-snapdragons/snapdragon-token.git"},"bugs":{"url":"https://github.com/here-be-snapdragons/snapdragon-token/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=4"},"scripts":{"test":"mocha","cover":"nyc mocha"},"dependencies":{"define-property":"^2.0.0","kind-of":"^6.0.1"},"devDependencies":{"mocha":"^3.4.2","gulp-format-md":"^1.0.0","nyc":"^11.3.0"},"keywords":["ast","capture","compile","compiler","convert","lex","lexer","parse","parser","render","snapdragon","token","tokenize","transform"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["snapdragon","snapdragon-node","snapdragon-util"]},"lint":{"reflinks":true}},"gitHead":"3d50111428044559ce64db8e4c3a6362cdff273c","_id":"snapdragon-token@2.0.0","_npmVersion":"5.5.1","_nodeVersion":"9.1.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"integrity":"sha512-RMYA4TzPeBqXApgYniuOgUA7DeIVHp46e8eCL/OXkSLNku6cAtVvjSfTKgYsl20Vo1AeoGHnfzciODl+rwfZPw==","shasum":"7d42fdfda6f12759563d0ed071aa134722d3c061","tarball":"http://registry-npm.ywwl.com/snapdragon-token/download/snapdragon-token-2.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBgKRe4kIF7AUVqpF8YrykGWNDAtHrhrOt+U7OGucVIMAiEAh/P27BEvNaW9MR2m04bbHgDWBi1BYoB+d6WW80s0x4k="}],"size":3690,"noattachment":false,"key":"/snapdragon-token/-/snapdragon-token-2.0.0.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/snapdragon-token-2.0.0.tgz_1512094495471_0.7145382107701153"},"directories":{},"readme":"# snapdragon-token [![NPM version](https://img.shields.io/npm/v/snapdragon-token.svg?style=flat)](https://www.npmjs.com/package/snapdragon-token) [![NPM monthly downloads](https://img.shields.io/npm/dm/snapdragon-token.svg?style=flat)](https://npmjs.org/package/snapdragon-token) [![NPM total downloads](https://img.shields.io/npm/dt/snapdragon-token.svg?style=flat)](https://npmjs.org/package/snapdragon-token) [![Linux Build Status](https://img.shields.io/travis/here-be/snapdragon-token.svg?style=flat&label=Travis)](https://travis-ci.org/here-be/snapdragon-token)\n\n> Create a snapdragon token. Used by the snapdragon lexer, but can also be used by plugins.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save snapdragon-token\n```\n\n## Usage\n\n```js\nconst Token = require('snapdragon-token');\n```\n\n## API\n\n### [Token](index.js#L18)\n\nCreate a new `Token` with the given `value` and `type`.\n\n**Params**\n\n* `type` **{String|Object}**: The token type to use when `value` is a string.\n* `value` **{String}**: Value to set\n* `returns` **{Object}**: Token instance\n\n**Example**\n\n```js\nconst token = new Token('*', 'Star');\nconst token = new Token({type: 'star', value: '*'});\nconsole.log(token) //=> Token { type: 'star', value: '*' }\n```\n\n## Release history\n\nSee [the changelog](CHANGELOG.md).\n\n## Token objects\n\nLexer tokens are represented as `Token` objects that implement the following interface:\n\n```js\ninterface Token {\n  type: string;\n  value: string;\n  match: array | undefined;\n}\n```\n\n### Token properties\n\n* `type` **{string}** - A string representing the token variant type. This property is necessary for classifying one or more characters so that parsers or compilers can determine what to do with the token.\n* `value` **{string}** - The substring (or [lexeme](#lexeme)) that was captured for the token.\n* `match` **{array|undefined}** - If a regular expression was used to capture a substring, the `RegExp.exec()` or `String.match()` arguments array can be stored on the token.\n\n**Source location**\n\nAdd the source location (start, end, index and range) information to tokens using either of the following plugins (depending on preference for property naming conventions):\n\n* [snapdragon-position](https://github.com/here-be/snapdragon-position)\n* [snapdragon-location](https://github.com/here-be/snapdragon-location)\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [snapdragon-node](https://www.npmjs.com/package/snapdragon-node): Snapdragon utility for creating a new AST node in custom code, such as plugins. | [homepage](https://github.com/jonschlinkert/snapdragon-node \"Snapdragon utility for creating a new AST node in custom code, such as plugins.\")\n* [snapdragon-util](https://www.npmjs.com/package/snapdragon-util): Utilities for the snapdragon parser/compiler. | [homepage](https://github.com/here-be/snapdragon-util \"Utilities for the snapdragon parser/compiler.\")\n* [snapdragon](https://www.npmjs.com/package/snapdragon): Easy-to-use plugin system for creating powerful, fast and versatile parsers and compilers, with built-in source-map… [more](https://github.com/here-be/snapdragon) | [homepage](https://github.com/here-be/snapdragon \"Easy-to-use plugin system for creating powerful, fast and versatile parsers and compilers, with built-in source-map support.\")\n\n### Author\n\n**Jon Schlinkert**\n\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 26, 2018._","publish_time":1512094496421,"_cnpm_publish_time":1512094496421,"dist-tags":{"latest":"4.0.0"}}