🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

tiny-stack

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-stack

Tiny stack for browser or server

0.1.0
Source
npm
Version published
Weekly downloads
1.5K
125.89%
Maintainers
1
Weekly downloads
 
Created
Source

Tiny Stack

Stack micro library for the browser or server. When loaded as a script tag on the browser, Tiny Stack be available as 'stack()'.

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

Example

var stack   = require("tiny-stack"),
    mystack = stack();


mystack.length(); // 0
mystack.push({name: "John Doe"});
mystack.push({name: "Jane Doe"});
mystack.length(); // 2
mystack.peek(); // {name: "Jane Doe"}
mystack.pop();
mystack.length(); // 1
mystack.peek(); // {name: "John Doe"}
mystack.clear();
mystack.length(); // 0

Keywords

stack

FAQs

Package last updated on 29 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts