1.1.3 • Published 3 years ago

panin v1.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Panin

A superset of function shortcuts. Built with TypeScript.

Note: This package is set of shortcuts, which makes calling JS's built-in features easier. WIP, still.

import { random, increment, chooseRandomFromArray, defaultVal, repeatEvery, log, map, push, parseJSON } from 'panin'

const awesomeArray = [{id: random(1, 99)}, {id: random(1, 99)}]; // This will give random id property between 1 and 99 to objects

console.log(awesomeArray);  

For parsing a JSON file, after importing parseJSON function and declaring ArrayOfThings in JSON file, use:

import ArrayOfThings from '../arrayOfThings.json'

console.log(parseJSON(ArrayOfThings));

Instead of using timeouts in JS, you can use following:

import { repeatEvery } from 'panin'

function example() {
    console.log("This function runs every 2 seconds!");
}

repeatEvery(2000, example);
1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago