Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Maintainers
1
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc