mapsave

0.1.1 • Public • Published

MapSave

I don't really know, I just had this idea and i made it.

What is this?

This is a map that easily can be saved to disk.

How do i use this?

Its easy, if you first run this:

let { MapSave } = require("mapsave"); // Import

let myMap = new MapSave("./save.mapsave"); // Create new map

myMap.set("Hello", "World"); // Set Key "Hello" to Value "World"

console.log(myMap.get("Hello")); // Should log "World" into console

myMap.save();

and the run:

let { MapSave } = require("mapsave"); // Import

let myMap = new MapSave("./save.mapsave"); // Create new map

console.log(myMap.get("Hello")); // Should still log "World" into console

This is basicly a normal Map with a save and a addSaveInterval function.

Save() function saves the map into a .mapsave file.

addSaveInterval(100ms) auto saves the Map every (in this case) 100ms.

Package Sidebar

Install

npm i mapsave

Weekly Downloads

0

Version

0.1.1

License

ISC

Unpacked Size

3.03 kB

Total Files

4

Last publish

Collaborators

  • swz-npm