npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

alisa.map

v0.1.0

Published

StrongMap, a more powerful and improved version of the map function

Downloads

20

Readme

Alisa Logo

Package Name Package size Version License

NPM

Source file

Creator(s)

Social media accounts

What is this module?

  • This module is more advanced version of Map function

  • This module provides a more stable way for you by eliminating the deficiencies and errors of the Map function

  • It has all the commands you need and there is an explanation of how each command should be used

So how to use?

It's very simple, first you have to open any javascript file and write the following in it:

// Node.js
const alisa_map = require("alisa.map")

// Without node.js
import alisa_map from "alisa.map"


// Build without any data in it
const StrongMap = new alisa_map()

// Build with data inside (Object)
const StrongMap_1 = new alisa_map({ key: "value", anotherKey: "anotherValue" }) 

// Build with data inside (Array)
const StrongMap_2 = new alisa_map([["key_1", "value_1"], ["anotherKey_1", "anotherValue_1"]])

// Build with data inside (Map or StrongMap)
const StrongMap_3 = new alisa_map(StrongMap_1)

Each StrongMap specifies a different Map function and the data they all hold is different. You can increase this as much as you want

After typing this you can access all commands

CAUTION!!

Please make your definitions as above. If you have made a definition as below, the module will not work properly and will give an error!

// Incorrect command definition

const alisa_map = require("alisa.map")

const { get, set } = new alisa_map()
// This command will throw an error!


const StrongMap = new alisa_map()
// This command will work as it should

Example

Now let's show how to write data to the Map function and call the written data

// Writing data to the Map function
StrongMap.set("hello", "World!")
StrongMap.set({ hello: "World!" }, 12345)

// Now when we print the StongMap function to the console, the following will appear on the screen:

Writing data to the Map function

Now let's try to pull the data we wrote

// Getting data from the Map function
StrongMap.get("hello") // "World!"

StrongMap.get({ hello: "World!" }) // 12345
// If you had tried to pull it with the normal Map function, it would most likely return undefined
// But thanks to this StrongMap module, it will return whatever data you typed, no matter what you typed

StrongMap module always wins

Now let's say you are pulling data from other files with the fs module. But since you are constantly using the readFile command, your code has started to slow down. This is where StrongMap comes into play. If you save the file you pulled using StrongMap and save that file again, instead of reading that file, it will pull the cached data and thus the code you write will speed up.

What I'm about to tell you may sound a bit confusing to you, so let me show you an example right away.

// First we define our modules

const alisa_map = require("alisa.map")
const fs = require("fs") 
// or
import alisa_map from "alisa.map";
import fs from "fs";

const StrongMap = new alisa_map()

// Then we write the commands to pull the file into a function
function getFile(fileName) {

    // If the file is in the cache, it will pull the file directly without using fs commands
    if (StrongMap.has(fileName)) return StrongMap.get(fileName)

    // If it is not in the cache, it pulls the file with the fs module and saves the data in the cache for later use
    try {

        let file = fs.readFileSync(fileName, "utf-8")

        StrongMap.set(fileName, file)

        return file

    } catch (error) {
      throw new TypeError(`File ${fileName} not found!`)
    }

}


getFile("example.txt") // It pulls this file with the fs module

getFile("example.txt") // But since we pulled this file earlier, it pulls it from the cache (Faster)

So why alisa.map?

  • The StrongMap module is a fairly simple yet effective module and overpowered for its package size

  • The StrongMap module is an open source module, so if you get an error you can fix it yourself

  • The StrongMap module is being developed every day, helping you in the best way with new features and increasing performance

  • You don't have to wait long while downloading due to the low package size

  • Aaaannddd if you download it you will make me very happy 👉👈

Updates

v0.0.8

  • Added examples to README.md file

v0.0.6

  • Fixed some typos

  • Updated README.md file

v0.0.5

  • The error in the console has also been fixed, now you can use the module without any problems yey

v0.0.4

  • Added .deleteFirst() and .deleteLast() commands

  • The error of not being able to import the module has been fixed (If you see an error on the console while importing the module, ignore it)

v0.0.3

  • Added .isEmpty() command

  • Some bugs fixed

v0.0.2

  • Fixed wrong places in README.md file...

v0.0.1

  • Module shared publicly 🥳🥳

Please do not forget to use it in the latest version for more stable and performance of the module!

And finally

  • If you want to support this module, if you request me on github, I will be happy to help you

  • Thank you for reading this far, i love you 💗

  • See you in my next modules!

lovee