es6-map-json

1.0.1 • Public • Published

es6-map-json

npm version

A package that combines the ES6 Map data structure with JSON file read/write functionality.

Installation

You can install the es6-map-json package via npm:

npm install es6-map-json

Usage

To use the JsonMap class provided by es6-map-json, import it into your project and create a new instance:

const JsonMap = require('es6-map-json');

// Create a new instance of JsonMap with a file path
const myMap = new JsonMap('data.json', null, 2, process.cwd());

// Use it like a regular Map
myMap.set('key', 'value');
console.log(myMap.get('key')); // Output: 'value'

// Changes are automatically saved to the JSON file

Features

  • Extends the ES6 Map data structure.
  • Automatically reads data from a JSON file upon instantiation.
  • Automatically saves data to a JSON file after every modification.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

Author

This package is created and maintained by Liane Cagara.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Package Sidebar

Install

npm i es6-map-json

Weekly Downloads

6

Version

1.0.1

License

ISC

Unpacked Size

6.46 kB

Total Files

10

Last publish

Collaborators

  • nealianacagara