tiny-stack

WebJar for tiny-stack

License

License

BSD 3-Clause
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

tiny-stack
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

tiny-stack
WebJar for tiny-stack
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/avoidwork/tiny-stack

Download tiny-stack

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/tiny-stack/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>tiny-stack</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/tiny-stack/
implementation 'org.webjars.npm:tiny-stack:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/tiny-stack/
implementation ("org.webjars.npm:tiny-stack:1.1.0")
'org.webjars.npm:tiny-stack:jar:1.1.0'
<dependency org="org.webjars.npm" name="tiny-stack" rev="1.1.0">
  <artifact name="tiny-stack" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='tiny-stack', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "tiny-stack" % "1.1.0"
[org.webjars.npm/tiny-stack "1.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Tiny Stack

Stack for Client or Server.

build status

API

clear

Clears the stack

length

Gets the length/size of the stack

peek

Gets the top item of the stack

pop

Gets & removes the top item of the stack

push

Adds an item to the top the stack

empty

Tests if this stack is empty

search

Returns the 1-based position where an object is on this stack

Example

const stack = require("tiny-stack"),
    mystack = stack(),
    jane = {name: "Jane Doe"},
    john = {name: "John Doe"};

mystack.length(); // 0
mystack.empty(); // true
mystack.push(john);
mystack.push(jane);
mystack.length(); // 2
mystack.search(jane); // 1
mystack.search(john); // 2
mystack.search({}); // -1
mystack.empty(); // false
mystack.peek(); // {name: "Jane Doe"}
mystack.pop();
mystack.length(); // 1
mystack.peek(); // {name: "John Doe"}
mystack.clear();
mystack.length(); // 0

License

Copyright (c) 2018 Jason Mulligan Licensed under the BSD-3-Clause license.

Versions

Version
1.1.0