# stack-ds

> A simple stack data structure.

Latest version **1.0.1** (published 2016-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install stack-ds
pnpm add stack-ds
yarn add stack-ds
bun add stack-ds
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-09-24 |
| First published | 2016-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Skevos Papamichail |
| Maintainers | skpapam |
| Keywords | stack, data structures |

## Links

- npm: https://www.npmjs.com/package/stack-ds
- Repository: https://github.com/skpapam/stack-ds
- Homepage: https://github.com/skpapam/stack-ds#readme
- Issues: https://github.com/skpapam/stack-ds/issues
- npm.io page: https://npm.io/package/stack-ds

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-09-24
- 1.0.0 — 2016-09-22

## README

# stack-ds

A simple stack data structure.

## Installation

```bash
	npm install stack-ds -save
```

## API 

* **Stack()** - Constructor `var mystack = new Stack();`

* **Stack.isStack(obj)** - Check if obj is Stack. Returns boolean. `Stack.isStack(myobject);`  

* **.push(obj)** - Push an obj into the stuck. Returns this. `mystack.push({a:5});`

* **.pop()** - Pop the top object from the stack. Returns the poped object `mystack.pop();`

* **.peek()** - Get the top object. `var top = mystack.peek();`

* **.size()** - Get the size of the stack. `var size = mystack.size();`

* **.isEmpty()** - Check if the stack is empty. Returns boolean. `mystack.isEmpty();`

* **.setMaxSize(max_size)** - Set the maximum size of the stack. Returns this. `mystack.setMaxtSize(10);`

* **.getMaxSize()** - Get the maximum size of the stack. `mystack.getMaxtSize();`

* **.empty()** - Empty the stack. Returns this. `mystack.empty();`

* **.isFull()** - Check if the stack is full. Returns boolean. `mystack.isEmpty();`

* **.copy(other)** - Copies other into this. Returns this. `mystack.copy(otherstack);`

* **.compare(other)** - Compares other and this stacks. Returns boolean. `mystack.compare(otherstack;`

* **.toString(debug)** - Export a string representation of the stack. If debug is set to true will export a full representation for each element `mystack.toString();`

* **.toArray()** - Exports an array with stacks's data. `mystack.toArray();`

## TEST

In order to test the library run : 

```bash
	npm test
```

**You need to have mocha installed**

```bash
	npm install -g mocha
```

## LICENSE 
MIT

Copyright (c) 2016 Skevos Papamichail &lt;contact@skevosp.me&gt; (www.skevosp.me)

---
_Source: https://npm.io/package/stack-ds · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
