1.5.9 • Published 7 years ago

collection-util-js v1.5.9

Weekly downloads
17
License
MIT
Repository
github
Last release
7 years ago

CollectionJS - Javascript dictionary library v1.5.9

Build Status

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.

<script src="./node_modules/collection-util-js/dist/collection-min.js"></script>

Types

  • List Object
  • Dictionary Object
var somelist = new Collection.List();
var someDictionary = new Collection.Dictionary();

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 = new Collection.List();
somelist.add('hello');
somelist.add('test');
somelist.toArray() // ['hello', 'test']

Dictionary

var someDictionary = new Collection.Dictionary();
somelist.add('MyKey', 'MyValue');
somelist.add('MyKey2', 'MyValue2');
somelist.toArray(); // ['MyValue', 'MyValue']
somelist.get('MyKey') // => MyValue

Tests

You can test running the following command in package's directory:

npm test
1.5.9

7 years ago

1.5.8

7 years ago

1.5.7

7 years ago

1.5.6

7 years ago

1.5.5

7 years ago

1.5.4

7 years ago

1.5.3

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago