{"id":20368509,"url":"https://github.com/greybax/stack-data","last_synced_at":"2026-02-18T15:01:38.524Z","repository":{"id":57369142,"uuid":"51880539","full_name":"greybax/stack-data","owner":"greybax","description":"Simple stack imlementation on ES6","archived":false,"fork":false,"pushed_at":"2019-04-19T00:59:17.000Z","size":10,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T11:39:06.112Z","etag":null,"topics":["algorithm","algorithm-and-data-structure","algorithm-and-datastructure","algorithms-datastructures","data-stack","data-structure","data-structures","datastructure","datastructures","es6","es6-javascript","js","js-data","stack","stack-based","stack-data","stacks","stacks-project","structured-data","structures"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greybax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-17T00:12:51.000Z","updated_at":"2017-06-09T22:47:49.000Z","dependencies_parsed_at":"2022-09-09T13:10:31.340Z","dependency_job_id":null,"html_url":"https://github.com/greybax/stack-data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greybax%2Fstack-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greybax%2Fstack-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greybax%2Fstack-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greybax%2Fstack-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greybax","download_url":"https://codeload.github.com/greybax/stack-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241913787,"owners_count":20041459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","algorithm-and-data-structure","algorithm-and-datastructure","algorithms-datastructures","data-stack","data-structure","data-structures","datastructure","datastructures","es6","es6-javascript","js","js-data","stack","stack-based","stack-data","stacks","stacks-project","structured-data","structures"],"created_at":"2024-11-15T00:41:29.903Z","updated_at":"2025-10-11T17:47:46.786Z","avatar_url":"https://github.com/greybax.png","language":"JavaScript","readme":"# stack-data\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/greybax/stack-data.svg)](https://greenkeeper.io/)\n\n[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coveralls Status][coveralls-image]][coveralls-url]\n[![Dependency Status][depstat-image]][depstat-url]\n[![DevDependency Status][depstat-dev-image]][depstat-dev-url]\n\n\u003e Simple stack implementation on ES6\n\n## Install\n\n    npm install --save stack-data\n\n## Usage\n\n### 2 ways for adding element in stack:\n\n* in constructor ```new Stack(1,\"2\",3,[4, 5],6);```\n* via ```push(elem)``` method\n\nAlso supports chaining mechanism like:\n\n```js\n new Stack()\n .push(1)\n .push(2)\n .push(3)\n .push(4)\n \n // creates object with 4 elements 1,2,3,4\n```\n\n```js\n// Examples of using stack-data\n\n//Added stack elements in constructor\nlet preInitStack = new Stack(1,\"2\",3,[4, 5],6);\npreInitStack.size;       //5\n\n//Added elements classically via push()\nlet stack = new Stack();\nstack.size;              //0\nstack.push(1).push(\"2\");\nstack.size;              //2\nstack.pop();             //\"2\"\nstack.size;              //1\nstack.peek();            //1\nstack.size;              //1\n```\n\n## API\n\n### push(elem)\n\n```push``` - Pushes element into stack. Throws an ```StackException``` when parameter is empty.\n\n#### elem\n\n*Required*  \nType: `Object`\n\n```elem``` - object which will be putted into stack\n\n### pop()\n\n```pop``` - Takes top element from the stack. Throws an ```StackException``` when the stack is empty.\n\n### peek()\n\n```peek``` - Peeks at the top element of the stack. Throws an ```StackException``` when the stack is empty.\n\n### size\n\n```size``` - Returns the size of the stack.\n\n## License\n\nMIT © Aleksandr Filatov \u003cgreybax@gmail.com\u003e \n\n[npm-url]: https://npmjs.org/package/stack-data\n[npm-image]: https://img.shields.io/npm/v/stack-data.svg?style=flat-square\n\n[travis-url]: https://travis-ci.org/greybax/stack-data\n[travis-image]: https://img.shields.io/travis/greybax/stack-data/master.svg?style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/greybax/stack-data\n[coveralls-image]: https://img.shields.io/coveralls/greybax/stack-data/master.svg?style=flat-square\n\n[depstat-url]: https://david-dm.org/greybax/stack-data\n[depstat-image]: https://david-dm.org/greybax/stack-data.svg?style=flat-square\n\n[depstat-dev-url]: https://david-dm.org/greybax/stack-data#info=devDependencies\n[depstat-dev-image]: https://david-dm.org/greybax/stack-data/dev-status.svg?style=flat-square","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreybax%2Fstack-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreybax%2Fstack-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreybax%2Fstack-data/lists"}