98 lines
5.5 KiB
JSON
98 lines
5.5 KiB
JSON
|
{
|
||
|
"_args": [
|
||
|
[
|
||
|
{
|
||
|
"raw": "jest-docblock@22.1.0",
|
||
|
"scope": null,
|
||
|
"escapedName": "jest-docblock",
|
||
|
"name": "jest-docblock",
|
||
|
"rawSpec": "22.1.0",
|
||
|
"spec": "22.1.0",
|
||
|
"type": "version"
|
||
|
},
|
||
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/metro"
|
||
|
]
|
||
|
],
|
||
|
"_from": "jest-docblock@22.1.0",
|
||
|
"_id": "jest-docblock@22.1.0",
|
||
|
"_inCache": true,
|
||
|
"_location": "/jest-docblock",
|
||
|
"_nodeVersion": "9.4.0",
|
||
|
"_npmOperationalInternal": {
|
||
|
"host": "s3://npm-registry-packages",
|
||
|
"tmp": "tmp/jest-docblock-22.1.0.tgz_1516017420961_0.029495719820261"
|
||
|
},
|
||
|
"_npmUser": {
|
||
|
"name": "cpojer",
|
||
|
"email": "christoph.pojer@gmail.com"
|
||
|
},
|
||
|
"_npmVersion": "5.6.0",
|
||
|
"_phantomChildren": {},
|
||
|
"_requested": {
|
||
|
"raw": "jest-docblock@22.1.0",
|
||
|
"scope": null,
|
||
|
"escapedName": "jest-docblock",
|
||
|
"name": "jest-docblock",
|
||
|
"rawSpec": "22.1.0",
|
||
|
"spec": "22.1.0",
|
||
|
"type": "version"
|
||
|
},
|
||
|
"_requiredBy": [
|
||
|
"/jest-haste-map",
|
||
|
"/metro"
|
||
|
],
|
||
|
"_resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-22.1.0.tgz",
|
||
|
"_shasum": "3fe5986d5444cbcb149746eb4b07c57c5a464dfd",
|
||
|
"_shrinkwrap": null,
|
||
|
"_spec": "jest-docblock@22.1.0",
|
||
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/metro",
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/facebook/jest/issues"
|
||
|
},
|
||
|
"dependencies": {
|
||
|
"detect-newline": "^2.1.0"
|
||
|
},
|
||
|
"description": "`jest-docblock` is a package that can extract and parse a specially-formatted comment called a \"docblock\" at the top of a file.",
|
||
|
"devDependencies": {},
|
||
|
"directories": {},
|
||
|
"dist": {
|
||
|
"integrity": "sha512-/+OGgBVRJb5wCbXrB1LQvibQBz2SdrvDdKRNzY1gL+OISQJZCR9MOewbygdT5rVzbbkfhC4AR2x+qWmNUdJfjw==",
|
||
|
"shasum": "3fe5986d5444cbcb149746eb4b07c57c5a464dfd",
|
||
|
"tarball": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-22.1.0.tgz"
|
||
|
},
|
||
|
"homepage": "https://github.com/facebook/jest#readme",
|
||
|
"license": "MIT",
|
||
|
"main": "build/index.js",
|
||
|
"maintainers": [
|
||
|
{
|
||
|
"name": "mjesun",
|
||
|
"email": "mjesun@hotmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "aaronabramov",
|
||
|
"email": "aaron@abramov.io"
|
||
|
},
|
||
|
{
|
||
|
"name": "jeanlauliac",
|
||
|
"email": "jean@lauliac.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "cpojer",
|
||
|
"email": "christoph.pojer@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "fb",
|
||
|
"email": "opensource+npm@fb.com"
|
||
|
}
|
||
|
],
|
||
|
"name": "jest-docblock",
|
||
|
"optionalDependencies": {},
|
||
|
"readme": "# jest-docblock\n\n`jest-docblock` is a package that can extract and parse a specially-formatted\ncomment called a \"docblock\" at the top of a file.\n\nA docblock looks like this:\n\n```js\n/**\n * Stuff goes here!\n */\n```\n\nDocblocks can contain pragmas, which are words prefixed by `@`:\n\n```js\n/**\n * Pragma incoming!\n *\n * @flow\n */\n```\n\nPragmas can also take arguments:\n\n```js\n/**\n * Check this out:\n *\n * @myPragma it is so cool\n */\n```\n\n`jest-docblock` can:\n\n* extract the docblock from some code as a string\n* parse a docblock string's pragmas into an object\n* print an object and some comments back to a string\n\n## Installation\n\n```sh\n# with yarn\n$ yarn add jest-docblock\n# with npm\n$ npm install jest-docblock\n```\n\n## Usage\n\n```js\nconst code = `\n/**\n * Everything is awesome!\n *\n * @everything is:awesome\n * @flow\n */\n \n export const everything = Object.create(null);\n export default function isAwesome(something) {\n return something === everything;\n }\n`;\n\nconst {\n extract,\n strip,\n parse,\n parseWithComments,\n print,\n} = require('jest-docblock');\n\nconst docblock = extract(code);\nconsole.log(docblock); // \"/**\\n * Everything is awesome!\\n * \\n * @everything is:awesome\\n * @flow\\n */\"\n\nconst stripped = strip(code);\nconsole.log(stripped); // \"export const everything = Object.create(null);\\n export default function isAwesome(something) {\\n return something === everything;\\n }\"\n\nconst pragmas = parse(docblock);\nconsole.log(pragmas); // { everything: \"is:awesome\", flow: \"\" }\n\nconst parsed = parseWithComments(docblock);\nconsole.log(parsed); // { comments: \"Everything is awesome!\", pragmas: { everything: \"is:awesome\", flow: \"\" } }\n\nconsole.log(print({pragmas, comments: 'hi!'})); // /**\\n * hi!\\n *\\n * @everything is:awesome\\n * @flow\\n */;\n```\n\n## API Documentation\n\n### `extract(contents: string): string`\n\nExtracts a docblock from some file contents. Returns the docblock contained in\n`contents`. If `contents` did not contain a docblock, it will return the empty\nstring (`\"\"`).\n\n### `strip(contents: string): string`\n\nStrips the top docblock from a file and return the result. If a file does not\nhave a docblock at the top, then return the file unchanged.\n\n### `parse(docblock: string): {[key: string]: string}`\n\nParses the pragmas in a docblock string into an object whose keys are the pragma\ntags and whose values are the arguments to those pragmas.\n\n### `parseWithComments(docblock: string): { comments: string, pragmas: {[key: string]: string} }`\n\nSimilar to `parse` except this method also returns the comments from the\ndocblock. Useful when used with `print()`.\n\n### `print({ comments?: string, pragmas?: {[key: string]: string} }): string`\n\nPrints an object of key-value pairs back into a docblock. If `comments` are\nprovided, they will be positioned on the top of the docblock.\n",
|
||
|
"readmeFilename": "README.md",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "git+https://github.com/facebook/jest.git"
|
||
|
},
|
||
|
"version": "22.1.0"
|
||
|
}
|