Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-structures

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-structures

Simple implementation of data structures in Javascript.

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

node-structures

Build Status npm Code Climate

Basic Data Structures for use in JavaScript (server-side, client side)

Description

The Library provides the following Data Structure Implementations

  1. Stack

Installation

Server-side: npm install node-structures

Client-side: bower install node-structures

Usage

###Stack

  const Stack = require('node-structures').Stack;
  let stack = new Stack();
  
  /**
   * Tests if this stack is empty.
   * @returns {boolean} - true if and only if this stack contains no items; false otherwise.
   */
  stack.isEmpty();
  
  /**
   * Pushes an item onto the top of this stack.
   * @param item - the item to be pushed onto this stack.
   * @return {boolean} - true if the item is pushed.
   */
  stack.push(3);
  
  /**
   * Looks at the object at the top of this stack without removing it from the stack.
   * @throws {Error} - if this stack is empty.
   * @returns {*} - the object at the top of this stack (the last item of the Vector object).
   */
  stack.peek();
  
  /**
   * Removes the object at the top of this stack and returns that object as the value of this function.
   * @throws {Error} - if this stack is empty.
   * @return {*} - the object at the top of this stack (the last item of the Vector object).
   */
  stack.pop();
  
  /**
   * Returns the size of the stack.
   * @returns {Number} - the size of the stack.
   */
  stack.size();

License

MIT

Keywords

FAQs

Package last updated on 06 Dec 2016

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