Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 883 Bytes

README.md

File metadata and controls

29 lines (18 loc) · 883 Bytes

JSHashtable for nodejs

PLEASE NOTE NodeJS now supports Map which achieves natively what this library attempts to do.

Port of jshashtable as nodejs package. jshashtable is a standalone implementation of hash table in JavaScript. It associates keys with values, and allows any object to be used as the key (unlike JavaScript's built-in Object, which only allows strings as property names).

Original website: http://www.timdown.co.uk/jshashtable/

Installation:

npm install jshashtable

Usage:

var Hashtable = require('jshashtable');
var typesHash = new Hashtable();

typesHash.put("A string", "string");
typesHash.put(1, "number");

var o = {};
typesHash.put(o, "object");

console.log( typesHash.get(o) ); // "object"