{"name":"snapdragon-token","description":"Create a snapdragon token. Used by the snapdragon lexer, but can also be used by plugins.","version":"3.0.1","homepage":"https://github.com/here-be/snapdragon-token","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/here-be/snapdragon-token.git"},"bugs":{"url":"https://github.com/here-be/snapdragon-token/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=6"},"scripts":{"test":"mocha","cover":"nyc mocha"},"dependencies":{"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":"3463acd7a5c4785ffed295fceaff5fb8a3fb2cb5","_id":"snapdragon-token@3.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.1.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"integrity":"sha512-c75KtniEOsODvOwzXEl1mrJtCZUABJAoja75ZaCMlkx+fvwyBZiOvShEjm/uESEWxgpnpd5Awa1tN8PCb/nLFg==","shasum":"74b5000ed22aacfa4f2d259a471767a580527f4c","tarball":"http://registry-npm.ywwl.com/snapdragon-token/download/snapdragon-token-3.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG3fHa1+9+sKDSi6aHrFaIHWUlorya8bqC8c4SRr7/iAAiEA7IZAN/I0E7nmRD587BFRNIMlp8zVoI6cq6lHcz0qKmc="}],"size":3845,"noattachment":false,"key":"/snapdragon-token/-/snapdragon-token-3.0.1.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/snapdragon-token-3.0.1.tgz_1514157565484_0.38366844062693417"},"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":1514157566375,"_cnpm_publish_time":1514157566375,"dist-tags":{"latest":"4.0.0"}}