Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@okikio/manager

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@okikio/manager

A superset of the Map class, it gives the Map class superpowers.

  • 2.2.0
  • beta
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
125
decreased by-1.57%
Maintainers
1
Weekly downloads
 
Created
Source

@okikio/manager

npm npm bundle size GitHub

A superset of the Map class, it extends the Map classes capabilities with awesome new features; it weighs ~325 B (minified and gzipped).

Table of Contents

Getting started

The Manager class makes Maps easier to use, as well as adding 7 methods, getMap, last, methodCall, add, remove, keys and values, (methodCall is a seperate method from the Manager class, so treeshaking can get rid of it, if it isn't need).

Note: the behavior of the keys and values methods are slightly modified, to return an Array of keys/values instead of an iterator. You can get the keys and values original effects by using .getMap().keys() or .getMap().values().

Installation

You can install @okikio/manager from npm via npm i @okikio/manager, pnpm i @okikio/animate or yarn add @okikio/manager.

You can use @okikio/manager on the web via:

Once installed it can be used like this:

// There is,
//      .cjs - Common JS Module
//      .mjs - Modern ES Module
//      .js - IIFE
import { Manager } from "@okikio/manager";
import { Manager } from "https://unpkg.com/@okikio/manager";
import { Manager } from "https://cdn.jsdelivr.net/npm/@okikio/manager";
// Or
import { Manager } from "https://cdn.skypack.dev/@okikio/manager";

// Via script tag
<script src="https://unpkg.com/@okikio/manager/lib/api.js"></script>
// Do note, on the web you need to do this, if you installed it via the script tag:
const { Manager, methodCall } = window.manager;
// or
const { default: Manager, methodCall } = window.manager;

Usage

@okikio/manager is used the same way Map is used. Like this,

In typescript,

import { Manager } from "@okikio/manager";

let elements = new Manager<number, Node>();
let el = document.querySelector(".div");
elements.add(el);
elements.set(1, el.cloneNode());

In javascript,

import { Manager } from "@okikio/manager";

let elements = new Manager();
let el = document.querySelector(".div");
elements.add(el);
elements.set(1, el.cloneNode());

Read through the API guide to learn more.

Browser & Node Support

ChromeEdgeFirefoxIE
> 38> 12> 13> 11

Learn about polyfilling, bundling, and more in the platform support guide.

Contributing

If there is something I missed, a mistake, or a feature you would like added please create an issue or a pull request on the beta branch and I'll try to get to it.

You can try out @okikio/manager using Gitpod:

Open In Gitpod

Read through the contributing documentation for detailed guides.

Keywords

FAQs

Package last updated on 30 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc