Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

WilsontheWolf/map-obj-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'

About

Convert JS Maps (and Enmaps) to objects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published