{"_id":"snapdragon-stack","_rev":"25518","name":"snapdragon-stack","description":"Snapdragon utility for creating a stack.","dist-tags":{"latest":"2.1.0"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:02:27.000Z","created":"2018-01-08T06:25:26.441Z","2.1.0":"2018-01-21T21:41:33.027Z","2.0.0":"2018-01-11T10:00:46.905Z","1.0.1":"2018-01-08T06:27:06.194Z","1.0.0":"2018-01-08T06:25:26.441Z"},"users":{},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/here-be/snapdragon-stack.git"},"versions":{"2.1.0":{"name":"snapdragon-stack","description":"Snapdragon utility for creating a stack.","version":"2.1.0","homepage":"https://github.com/here-be/snapdragon-stack","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/here-be/snapdragon-stack.git"},"bugs":{"url":"https://github.com/here-be/snapdragon-stack/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=6"},"scripts":{"test":"mocha"},"devDependencies":{"gulp-format-md":"^1.0.0","mocha":"^3.5.3"},"keywords":["compile","compiler","convert","parse","parser","render","snapdragon","stack","transform"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true}},"gitHead":"dba2a12f200b9ce143468d9e589069f7628b9471","_id":"snapdragon-stack@2.1.0","_npmVersion":"5.6.0","_nodeVersion":"9.1.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"133cb5bca0322be94bb5e75f6dff91997f14b3a8","size":3222,"noattachment":false,"key":"/snapdragon-stack/-/snapdragon-stack-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/snapdragon-stack/download/snapdragon-stack-2.1.0.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/snapdragon-stack-2.1.0.tgz_1516570892056_0.9831322571262717"},"directories":{},"publish_time":1516570893027,"_cnpm_publish_time":1516570893027,"_hasShrinkwrap":false},"2.0.0":{"name":"snapdragon-stack","description":"Snapdragon utility for creating a stack.","version":"2.0.0","homepage":"https://github.com/here-be/snapdragon-stack","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/here-be/snapdragon-stack.git"},"bugs":{"url":"https://github.com/here-be/snapdragon-stack/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=6"},"scripts":{"test":"mocha"},"devDependencies":{"gulp-format-md":"^1.0.0","mocha":"^3.5.3"},"keywords":["compile","compiler","convert","parse","parser","render","snapdragon","stack","transform"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true}},"gitHead":"8eb32982802b6e913627b96844e8b1a1cde1a6f3","_id":"snapdragon-stack@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.1.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"2ddab9747e2f8260f0f3559bdbb847726f752cdd","size":2722,"noattachment":false,"key":"/snapdragon-stack/-/snapdragon-stack-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/snapdragon-stack/download/snapdragon-stack-2.0.0.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/snapdragon-stack-2.0.0.tgz_1515664845932_0.006257901433855295"},"directories":{},"publish_time":1515664846905,"_hasShrinkwrap":false,"_cnpm_publish_time":1515664846905},"1.0.1":{"name":"snapdragon-stack","description":"Snapdragon utility for creating a stack.","version":"1.0.1","homepage":"https://github.com/here-be/snapdragon-stack","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/here-be/snapdragon-stack.git"},"bugs":{"url":"https://github.com/here-be/snapdragon-stack/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=6"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"^4.0.1","gulp-format-md":"^1.0.0"},"keywords":["compile","compiler","convert","parse","parser","render","snapdragon","stack","transform"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true}},"gitHead":"f2b60997700fa50ff3a614fc8a9ac8e49e12b431","_id":"snapdragon-stack@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"9.1.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"39f50b7657dce4c4b663a3059b8c16ecb297b45f","size":2767,"noattachment":false,"key":"/snapdragon-stack/-/snapdragon-stack-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/snapdragon-stack/download/snapdragon-stack-1.0.1.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/snapdragon-stack-1.0.1.tgz_1515392825331_0.25373057811520994"},"directories":{},"publish_time":1515392826194,"_cnpm_publish_time":1515392826194,"_hasShrinkwrap":false},"1.0.0":{"name":"snapdragon-stack","description":"Snapdragon utility for creating a stack.","version":"1.0.0","homepage":"https://github.com/here-be/snapdragon-stack","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/here-be/snapdragon-stack.git"},"bugs":{"url":"https://github.com/here-be/snapdragon-stack/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=4"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"^4.0.1","gulp-format-md":"^1.0.0"},"keywords":["compile","compiler","convert","parse","parser","render","snapdragon","stack","transform"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true}},"gitHead":"977f231234b132121013f2179523b1fd4869196d","_id":"snapdragon-stack@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.1.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"dist":{"shasum":"0ff0384a0c2fdfc4205c9b4d5f49caa8599de1c9","size":2769,"noattachment":false,"key":"/snapdragon-stack/-/snapdragon-stack-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/snapdragon-stack/download/snapdragon-stack-1.0.0.tgz"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/snapdragon-stack-1.0.0.tgz_1515392725542_0.9555053450167179"},"directories":{},"publish_time":1515392726441,"_hasShrinkwrap":false,"_cnpm_publish_time":1515392726441}},"readme":"# snapdragon-stack [![NPM version](https://img.shields.io/npm/v/snapdragon-stack.svg?style=flat)](https://www.npmjs.com/package/snapdragon-stack) [![NPM monthly downloads](https://img.shields.io/npm/dm/snapdragon-stack.svg?style=flat)](https://npmjs.org/package/snapdragon-stack) [![NPM total downloads](https://img.shields.io/npm/dt/snapdragon-stack.svg?style=flat)](https://npmjs.org/package/snapdragon-stack) [![Linux Build Status](https://img.shields.io/travis/here-be/snapdragon-stack.svg?style=flat&label=Travis)](https://travis-ci.org/here-be/snapdragon-stack)\n\n> Snapdragon utility for creating a stack.\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-stack\n```\n\n## Usage\n\n```js\nconst Stack = require('snapdragon-stack');\n```\n\n## API\n\n### [.first](index.js#L26)\n\nGet the first element in the stack.\n\n* `returns` **{any}**\n\n**Example**\n\n```js\nconst Stack = require('snapdragon-stack');\nstack.push('a');\nstack.push('b');\nstack.push('c');\nconsole.log(stack.first()); //=> 'a'\n```\n\n### [.lookbehind](index.js#L49)\n\nGet the `n`th element from the end of the stack.\n\n**Params**\n\n* `n` **{Number}**\n* `returns` **{Object}**\n\n**Example**\n\n```js\nconst stack = new Stack();\nstack.push('aaa');\nstack.push('bbb');\nstack.push('ccc');\nstack.push('ddd');\nconsole.log(stack.lookbehind(1)); //=> 'ddd'\nconsole.log(stack.lookbehind(2)); //=> 'ccc'\nconsole.log(stack.lookbehind(3)); //=> 'bbb'\n```\n\n### [.last](index.js#L69)\n\nGet the last element in the stack.\n\n* `returns` **{any}**\n\n**Example**\n\n```js\nconst Stack = require('snapdragon-stack');\nstack.push('a');\nstack.push('b');\nstack.push('c');\nconsole.log(stack.last()); //=> 'c'\n```\n\n### [.current](index.js#L86)\n\nSemantic alias for `stack.last()`.\n\n* `returns` **{any}**\n\n**Example**\n\n```js\nconst Stack = require('snapdragon-stack');\nstack.push({ type: 'root' });\nconsole.log(stack.current()); //=> { type: 'root' }\n```\n\n### [.prev](index.js#L105)\n\nGet the second-to-last item in the stack.\n\n* `returns` **{any}**\n\n**Example**\n\n```js\nconst Stack = require('snapdragon-stack');\nstack.push('a');\nstack.push('b');\nstack.push('c');\nconsole.log(stack.prev()); //=> 'b'\n```\n\n### [.firstChild](index.js#L130)\n\nIf the [.first](#first) element in the stack is an object with a `.nodes` array, the first item from `stack.first().nodes` is returned.\n\n* `returns` **{any}**\n\n**Example**\n\n```js\nconst Stack = require('snapdragon-stack');\nconst Node = require('snapdragon-node');\n\nconst node = new Node({ type: 'brace' });\nnode.push(new Node({ type: 'brace.open', value: '{' }));\nnode.push(new Node({ type: 'text', value: 'a,b,c' }));\nnode.push(new Node({ type: 'brace.close', value: '}' }));\n\nstack.push(node);\nconsole.log(stack.firstChild()); //=> Node { type: 'brace.open', value: '{' }\n```\n\n### [.lastChild](index.js#L158)\n\nIf the [.last](#last) element in the stack is an object with a `.nodes` array, the last item from `last.nodes` is returned.\n\n* `returns` **{any}**\n\n**Example**\n\n```js\nconst Stack = require('snapdragon-stack');\nconst Node = require('snapdragon-node');\n\nconst node = new Node({ type: 'brace' });\nnode.push(new Node({ type: 'brace.open', value: '{' }));\nnode.push(new Node({ type: 'text', value: 'a,b,c' }));\nnode.push(new Node({ type: 'brace.close', value: '}' }));\n\nstack.push(node);\nconsole.log(stack.lastChild()); //=> Node { type: 'brace.close', value: '}' }\n```\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<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### Author\n\n**Jon Schlinkert**\n\n* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert)\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](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 January 21, 2018._","_attachments":{},"homepage":"https://github.com/here-be/snapdragon-stack","bugs":{"url":"https://github.com/here-be/snapdragon-stack/issues"},"license":"MIT"}