CollectionJS
- Javascript dictionary library v1.5.9
A collection / dictionary list library for javascript. It provides a way to create enhanced Arrays, with search capabilities. Introduces two additional types of Arrays, the List and the Dictionary.
Installation
npm i collection-util-js
Declare the dist/collection-min.js to your html file and use it.
Types
- List Object
- Dictionary Object
var somelist = ;var someDictionary = ;
List Methods
- get
- add
- iterate
- remove
- has
- toArray
- parse
- toJSON
Dictionary Methods
- get
- add
- iterate
- remove
- has
- hasKey
- toArray
- parse
- toJSON
Examples
List
var somelist = ;somelist;somelist;somelist // ['hello', 'test']
Dictionary
var someDictionary = ;somelist;somelist;somelist; // ['MyValue', 'MyValue']somelist // => MyValue
Tests
You can test running the following command in package's directory:
npm test