axmap
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

AxMap

A javascript map, only more compact and with other features that do not have in the standard javascript Map!

Usage

Set , get and remove functions

    const axmap = require("axmap")

    const map = new axmap()

    map.set("Hello","World") // Expected: Promise<void>
    map.get("Hello") // Expected: World

    map.remove("Hello") // Expected: Remove "Hello" element from map, returns the key | null

Values and keys

    const axmap = require("axmap")

    const map = new axmap()
    map.set("Hello","World") // Expected: Promise<void>
    
    map.firstKey() // Expected: Hello
    map.firstValue() // Expected: World

    map.values() // Expected: [{key: "Hello", value: "World",index: 0}]

JSONS Load a map from JSON

   const axmap = require("axmap")

    const map = new axmap({load: require("path").resolve(__dirname,"path/to/json.json")})

    map.get("Hello") // Expected: World

Write a map to JSON

   const axmap = require("axmap")

    const map = new axmap()

    map.set("A","B")
    map.set("C","D")

     map.write(require("path").resolve(__dirname,"path/to/json.json")) // Expected: Promise<void>

Others functions

forEach

   const axmap = require("axmap")

    const map = new axmap()

    map.set(".",",")

    map.forEach((key, value, index) => /**Code*/)

Readme

Keywords

none

Package Sidebar

Install

npm i axmap

Weekly Downloads

0

Version

1.1.2

License

ISC

Unpacked Size

5.09 kB

Total Files

7

Last publish

Collaborators

  • leozin_