{"name":"snapdragon-token","description":"Create a snapdragon token. Used by the snapdragon lexer, but can also be used by plugins.","version":"4.0.0","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"},"devDependencies":{"gulp-format-md":"^1.0.0","mocha":"^3.5.3","nyc":"^11.7.1"},"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-tokenizer","snapdragon-util"]},"lint":{"reflinks":true},"reflinks":["snapdragon-location","snapdragon-position"]},"gitHead":"dbb6a209b8f1afc9117f888b59d05c4d2632d520","_id":"snapdragon-token@4.0.0","_npmVersion":"6.0.0","_nodeVersion":"9.9.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"integrity":"sha512-nMaDmbyBIVFOwnB5cnlSq+6+yihMzDw/Et6Wi299hYR6Ghta+Sgm02Rs4CC7i42KlcEAZGBVFK/9Y57fujIN+A==","shasum":"4cac515f5b9ea2881eae4a1ba1c0807e7dca5218","tarball":"http://registry-npm.ywwl.com/snapdragon-token/download/snapdragon-token-4.0.0.tgz","fileCount":5,"unpackedSize":10283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4a2WCRA9TVsSAnZWagAApGAP/0nz/B9W2xQc9oiIo+zy\njXXNc39KIHYwsU6YlQehSIx3pA58mIKhgCTPztd/+XgiHedfSDBcfp98DE89\npbAQrzFBtcrffdmfzv3ex3M17o8r1InPn2vhimh3HdX4mw+RcyyB6kZtgZz+\n9ZiWcSKVIzM/PlWkJaHUIWn94Cu46ksLprq8GeokNF4C7cpV7tKIDmNLizTp\n1GDoWDLggcGD6l23Rl+8+6gJjO3K5yDvfAKI3X3KS3jmrUEXK4CmdzAGGQbm\ng+0fzArNXnzPVrm4H1T7ZUeoCvZVP8swvcNO7yddHfIIaV7o4fudTw/FlNvn\nUUpBZ/E56KpN5nsYoIxmHgFam5NTiQIcBuA3rBeubDlQbrR5oYujJdAGwg/2\nO4nCwqglcvkAIKgLDuO2V8CywnDKRWdN4r8LZwowgmxiwY9d5xTwtgBgBE0E\nVnNKyz2wNeJ3whwTP6qkiJBjSqnAJ9z6ZzvjRwGsSnlOzjoLOuMtu+ZCTd/U\nhZUb4Ay5RajnPbG53WysdISBE+uO6PePjNEusqe47LpQ0yeUltzWUdvwGKRL\n+pmrgRKA/7S+8IlHAWrJxtWt5dRubeJVLX4T0k9EwYIhIPjQBLrDM51X7waR\nXo2b6ArAs4E0IerfDuN1DFFtOhSaUB0fqW+2/24iGzWK61rAJ2WeZvC4gSkV\nZehA\r\n=+JiK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICophJd2aK+Ws1EEvbbxcJreXyRScm8e2G9Bm+087+4/AiEAx8EVlEjiycumPVPwjAwW/yNMrlK/RgNZN+yo7NNwivc="}],"size":4165,"noattachment":false,"key":"/snapdragon-token/-/snapdragon-token-4.0.0.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/snapdragon-token_4.0.0_1524739477472_0.42940037104217677"},"_hasShrinkwrap":false,"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":1524739477589,"_cnpm_publish_time":1524739477589,"dist-tags":{"latest":"4.0.0"}}