map-obj-sync

1.0.0 • Public • Published

Map Obj Sync

Convert JS Maps (and Enmaps) to objects and keep them synced.

Installation

Just install through your node package manager of choice

npm install map-obj-sync
# or
yarn add map-obj-sync

Usage

 // This example uses Enmap (which should behave the same as another Map).
 
 // require the things
 const Enmap = require('enmap')
 const mapObj = require('map-obj-sync')
 
 // We make our enmap and the object.
 const db = new Enmap('name');
 const obj = mapObj(db);
 
 // usage
 
 db.get('e') // returns undefined
 db.set('e', 'eee') // e = 'eee'
 obj.e // returns 'eee'
 obj.e = 'hello world' // e = 'hello world'
 db.get('e') // returns 'hello world'

Readme

Keywords

none

Package Sidebar

Install

npm i map-obj-sync

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.64 kB

Total Files

7

Last publish

Collaborators

  • wilsonthewolf