You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
13 KiB

4 years ago
  1. {
  2. "_args": [
  3. [
  4. "snapdragon@^0.8.1",
  5. "/home/herrhase/Workspace/tentakelfabrik/tiny-components/tiny-consent/node_modules/micromatch"
  6. ]
  7. ],
  8. "_from": "snapdragon@>=0.8.1 <0.9.0",
  9. "_id": "snapdragon@0.8.2",
  10. "_inCache": true,
  11. "_installable": true,
  12. "_location": "/snapdragon",
  13. "_nodeVersion": "9.7.1",
  14. "_npmOperationalInternal": {
  15. "host": "s3://npm-registry-packages",
  16. "tmp": "tmp/snapdragon_0.8.2_1520776598430_0.674348590844402"
  17. },
  18. "_npmUser": {
  19. "email": "github@sellside.com",
  20. "name": "jonschlinkert"
  21. },
  22. "_npmVersion": "5.7.1",
  23. "_phantomChildren": {
  24. "is-descriptor": "0.1.6"
  25. },
  26. "_requested": {
  27. "name": "snapdragon",
  28. "raw": "snapdragon@^0.8.1",
  29. "rawSpec": "^0.8.1",
  30. "scope": null,
  31. "spec": ">=0.8.1 <0.9.0",
  32. "type": "range"
  33. },
  34. "_requiredBy": [
  35. "/braces",
  36. "/expand-brackets",
  37. "/extglob",
  38. "/micromatch",
  39. "/nanomatch"
  40. ],
  41. "_resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
  42. "_shasum": "64922e7c565b0e14204ba1aa7d6964278d25182d",
  43. "_shrinkwrap": null,
  44. "_spec": "snapdragon@^0.8.1",
  45. "_where": "/home/herrhase/Workspace/tentakelfabrik/tiny-components/tiny-consent/node_modules/micromatch",
  46. "author": {
  47. "name": "Jon Schlinkert",
  48. "url": "https://github.com/jonschlinkert"
  49. },
  50. "bugs": {
  51. "url": "https://github.com/jonschlinkert/snapdragon/issues"
  52. },
  53. "contributors": [
  54. {
  55. "name": "Brian Woodward",
  56. "url": "https://twitter.com/doowb"
  57. },
  58. {
  59. "name": "Edward Betts",
  60. "url": "http://edwardbetts.com"
  61. },
  62. {
  63. "name": "Jon Schlinkert",
  64. "url": "http://twitter.com/jonschlinkert"
  65. }
  66. ],
  67. "dependencies": {
  68. "base": "^0.11.1",
  69. "debug": "^2.2.0",
  70. "define-property": "^0.2.5",
  71. "extend-shallow": "^2.0.1",
  72. "map-cache": "^0.2.2",
  73. "source-map": "^0.5.6",
  74. "source-map-resolve": "^0.5.0",
  75. "use": "^3.1.0"
  76. },
  77. "description": "Fast, pluggable and easy-to-use parser-renderer factory.",
  78. "devDependencies": {
  79. "gulp": "^3.9.1",
  80. "gulp-eslint": "^3.0.1",
  81. "gulp-format-md": "^0.1.10",
  82. "gulp-istanbul": "^1.1.1",
  83. "gulp-mocha": "^3.0.1",
  84. "gulp-unused": "^0.2.0",
  85. "mocha": "^3.0.2"
  86. },
  87. "directories": {},
  88. "dist": {
  89. "fileCount": 9,
  90. "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
  91. "shasum": "64922e7c565b0e14204ba1aa7d6964278d25182d",
  92. "tarball": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
  93. "unpackedSize": 35228
  94. },
  95. "engines": {
  96. "node": ">=0.10.0"
  97. },
  98. "files": [
  99. "index.js",
  100. "lib"
  101. ],
  102. "gitHead": "6c952b12cabe896a86d9a4fe378f934bccbe6436",
  103. "homepage": "https://github.com/jonschlinkert/snapdragon",
  104. "keywords": [
  105. "lexer",
  106. "snapdragon"
  107. ],
  108. "license": "MIT",
  109. "main": "index.js",
  110. "maintainers": [
  111. {
  112. "name": "doowb",
  113. "email": "brian.woodward@gmail.com"
  114. },
  115. {
  116. "name": "jonschlinkert",
  117. "email": "github@sellside.com"
  118. }
  119. ],
  120. "name": "snapdragon",
  121. "optionalDependencies": {},
  122. "readme": "# snapdragon [![NPM version](https://img.shields.io/npm/v/snapdragon.svg?style=flat)](https://www.npmjs.com/package/snapdragon) [![NPM downloads](https://img.shields.io/npm/dm/snapdragon.svg?style=flat)](https://npmjs.org/package/snapdragon) [![Build Status](https://img.shields.io/travis/jonschlinkert/snapdragon.svg?style=flat)](https://travis-ci.org/jonschlinkert/snapdragon)\n\n> Fast, pluggable and easy-to-use parser-renderer factory.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save snapdragon\n```\n\nCreated by [jonschlinkert](https://github.com/jonschlinkert) and [doowb](https://github.com/doowb).\n\n**Features**\n\n* Bootstrap your own parser, get sourcemap support for free\n* All parsing and compiling is handled by simple, reusable middleware functions\n* Inspired by the parsers in [pug](http://jade-lang.com) and [css](https://github.com/reworkcss/css).\n\n## History\n\n### v0.5.0\n\n**Breaking changes**\n\nSubstantial breaking changes were made in v0.5.0! Most of these changes are part of a larger refactor that will be finished in 0.6.0, including the introduction of a `Lexer` class.\n\n* Renderer was renamed to `Compiler`\n* the `.render` method was renamed to `.compile`\n* Many other smaller changes. A more detailed overview will be provided in 0.6.0. If you don't have to time review code, I recommend you wait for the 0.6.0 release.\n\n## Usage examples\n\n```js\nvar Snapdragon = require('snapdragon');\nvar snapdragon = new Snapdragon();\n```\n\n**Parse**\n\n```js\nvar ast = snapdragon.parser('some string', options)\n // parser middleware that can be called by other middleware\n .set('foo', function () {})\n // parser middleware, runs immediately in the order defined\n .use(bar())\n .use(baz())\n```\n\n**Render**\n\n```js\n// pass the `ast` from the parse method\nvar res = snapdragon.compiler(ast)\n // compiler middleware, called when the name of the middleware\n // matches the `node.type` (defined in a parser middleware)\n .set('bar', function () {})\n .set('baz', function () {})\n .compile()\n```\n\nSee the [examples](./examples/).\n\n## Getting started\n\n**Parsers**\n\nParsers are middleware functions used for parsing a string into an ast node.\n\n```js\nvar ast = snapdragon.parser(str, options)\n .use(function() {\n var pos = this.position();\n var m = this.match(/^\\./);\n if (!m) return;\n return pos({\n // `type` specifies the compiler to use\n type: 'dot',\n val: m[0]\n });\n })\n```\n\n**AST node**\n\nWhen the parser finds a match, `pos()` is called, pushing a token for that node onto the ast that looks something like:\n\n```js\n{ type: 'dot',\n val: '.',\n position:\n { start: { lineno: 1, column: 1 },\n end: { lineno: 1, column: 2 } }}\n```\n\n**Renderers**\n\nRenderers are _named_ middleware functions that visit over an array of ast nodes to compile a string.\n\n```js\nvar res = snapdragon.compiler(ast)\n .set('dot', function (node) {\n console.log(node.val)\n //=> '.'\n return this.emit(node.val);\n })\n```\n\n**Source maps**\n\nIf you want source map support, make sure to emit the position as well.\n\n```js\nvar res = snapdragon.compiler(ast)\n .set('dot', function (node) {\n return this.emit(node.val, node.position);\n })\n```\n\n## Docs\n\n### Parser middleware\n\nA parser middleware is a function that returns an abject called a `token`. This token is pushed onto the AST as a node.\n\n**Example token**\n\n```js\n{ type: 'dot',\n val: '.',\n position:\n { start: { lineno: 1, column: 1 },\n end: { lineno: 1, column: 2 } }}\n```\n\n**Example parser middleware**\n\nMatch a single `.` in a string:\n\n1. Get the starting position by calling `this.position()`\n2. pass a regex for matching a single dot to the `.match` method\n3. if **no match** is found, return `undefined`\n4. if a **match** is found, `pos()` is called, which returns a token with:\n - `type`: the name of the [compiler] to use\n - `val`: The actual value captured by the regex. In this case, a `.`. Note that
  123. "readmeFilename": "README.md",
  124. "repository": {
  125. "type": "git",
  126. "url": "git+https://github.com/jonschlinkert/snapdragon.git"
  127. },
  128. "scripts": {
  129. "test": "mocha"
  130. },
  131. "verb": {
  132. "layout": "default",
  133. "lint": {
  134. "reflinks": true
  135. },
  136. "plugins": [
  137. "gulp-format-md"
  138. ],
  139. "reflinks": [
  140. "css",
  141. "pug",
  142. "verb",
  143. "verb-generate-readme"
  144. ],
  145. "related": {
  146. "description": "These libraries use snapdragon:",
  147. "list": [
  148. "braces",
  149. "expand-brackets",
  150. "extglob",
  151. "micromatch"
  152. ]
  153. },
  154. "tasks": [
  155. "readme"
  156. ],
  157. "toc": false
  158. },
  159. "version": "0.8.2"
  160. }