Socket
Book a DemoInstallSign in
Socket

@kraftvaerk/lota-js

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kraftvaerk/lota-js

Useful modular JavaScript bits with zero dependencies

1.0.0-alpha.0
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

lota-js

Build Status npm Version npm Downloads Dependency Status devDependency Status

All code is vanilla JS, library agnostic and consist mostly of helper methods that aren't directly related with the DOM, the purpose of this library is to provide modular solutions for common JS problems in kraftvaerk.

Main goals

  • increase code reuse;
  • be easy to debug;
  • be easy to maintain;
  • follow best practices;
  • be compatible with other frameworks;
  • be modular;

Installation

npm i @kraftvaerk/lota-js --save

Contents

Another Lodash?

No. The goal is to provide frontend developers in Kraftvaerk with a number of useful and small JavaScript codes, not just functions, but also modules and classes. Think of it as a mini version of npm suitable for tiny packages.

What shouldn't be here

  • UI components;
  • CSS selector engine;
  • Event system - pub/sub;
  • Template engine;
  • Anything that isn't generic enough;
  • Anything that could be a separate library and/or isn't a modular utility...

Submitting New Modules

Unable to find one suitable? Fork it on GitHub, add the module and submit a pull request.


⬆ Back to top

UUID

Generates a UUID in a browser. Use crypto API to generate a UUID, compliant with RFC4122 version 4.

const UUID = () =>
  ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
    (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
  );
Examples
import UUID from '@kraftvaerk/lota-js/uuid';

UUID(); // -> 0e3b84af-f911-4a55-b78a-cedf6f0bd815

License

MIT © Kraftvaerk

Keywords

kraftvaerk

FAQs

Package last updated on 15 Apr 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.