New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

array-list

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-list

Simple array list implementation.

latest
Source
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

array-list

Last version Build Status Coverage Status Dependency status Dev Dependencies Status NPM Status Donate

Simple array list implementation.

Install

$ npm install array-list --save

Usage

var arrayList = require('array-list')

// with limit
var arr = arrayList(100)

// without limit
var arr = arrayList()

API

arrayList([limit])

limit

Type: integer

Specify the limit of the array. It's need to be a positive integer number.

.size()

Returns how many elements are stored in the array list.

This value is different from .length, that returns the size reserved for the array.

.push({element})

It adds a new element in the array list.

This methods could be throw an error if:

  • You don't provide a valid element.
  • The array list is full.

.get([element])

It gets the elements in the array list.

You can specify an index, in other case the methods will return all the elements.

.clear()

It removes all the elements in the array list.

.flush()

It returns a copy of the elements in array list.

An alias from concat .get + .clear.

.isEmpty()

Returns true is the .size is 0; false in other case.

.isFull()

Returns true is the .size is equal to limit; false in other case.

  • array-future – A collection of Array prototypes prollyfills as proposition for ECMAScript 7.

License

MIT © Kiko Beats.

Keywords

array

FAQs

Package last updated on 20 Jan 2020

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