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

sorted-object-array

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sorted-object-array

An implementation of John von Neumann's sorted arrays in JavaScript. Implements insertion sort and binary search of JavaScript objects for fast insertion and deletion.

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Sorted Array

An implementation of John von Neumann's sorted arrays in JavaScript. Implements insertion sort and binary search of JavaScript objects for fast insertion and deletion.

Installation

Sorted arrays may be installed on node.js via the node package manager using the command npm install sorted-object-array.

Usage

The six line tutorial on sorted object arrays:

var SortedObjectArray = require("sorted-object-array");
var sorted = new SortedObjectArray('k', {k:1, v:''}, {k:2, v:''}, {k:3, v:''}, {k:4, v:''}, {k:5, v:''});
console.dir(sorted.array);                   // [{k:1, v:''}, {k:2, v:''}, {k:3, v:''}, {k:4, v:''}, {k:5, v:''}]
sorted.search(3);                            // 2
sorted.search({k:3});                        // 2
sorted.remove(3);                            // [{k:1, v:''}, {k:2, v:''}, {k:4, v:''}, {k:5, v:''}]
sorted.insert({k:3,v:'x'});                  // [{k:1, v:''}, {k:2, v:''}, {k:3, v:'x'}, {k:4, v:''}, {k:5, v:''}]

Keywords

sorted

FAQs

Package last updated on 29 Aug 2013

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