3.5.2 • Published 7 years ago

es6-native-set v3.5.2

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

es6-native-set

Set collection as specified in ECMAScript6

Uses native C++ unordered_set container, so the memory is stored outside of node and it is a lot faster than native JS implementations.

As of 2.0.0, requires node.js 0.12 or later. If you are running node.js 0.10, stick with the 1.x.x.

Usage

var Set = require('es6-native-set');

Installation

$ npm install es6-native-set

API

Best is to refer to specification. Still if you want quick look, follow examples:

var Set = require('es6-native-set');

var set = new Set();

set.add('raz').add('dwa').add({});
set.size;                 // 3
set.has('raz');           // true
set.has('foo');           // false
set.add('foo');           // set
set.size                  // 4
set.has('foo');           // true
set.has('dwa');           // true
set.delete('dwa');        // true
set.size;                 // 3

set.forEach(function (value) {
  // 'raz', {}, 'foo' iterated
});

var iterator = set.values();

iterator.next(); // { done: false, value: 'raz' }
iterator.next(); // { done: false, value: {} }
iterator.next(); // { done: false, value: 'foo' }
iterator.next(); // { done: true, value: undefined }

set.clear(); // undefined
set.size; // 0

This package is made possible because of Grokker, one of the best places to work. If you are a JS developer looking for a new gig, send me an email at ['chad', String.fromCharCode(64), 'grokker', String.fromCharCode(0x2e), 'com'].join('').

3.5.2

7 years ago

3.5.1

8 years ago

3.5.0

8 years ago

3.4.1

8 years ago

3.4.0

8 years ago

3.3.3

8 years ago

3.3.2

8 years ago

3.3.1

8 years ago

3.3.0

8 years ago

3.2.1

8 years ago

3.2.0

8 years ago

3.1.0

9 years ago

3.0.1

9 years ago

2.0.7

9 years ago

2.0.6

9 years ago

2.0.5

9 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.3.3

9 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago