tilly
v0.1.4
Published
Promise Utility Library
Downloads
6
Maintainers
Readme
Promise Utility Library
Small collection of functions designed to help the manipulation of the ES6 Promises with await operator.
This library is the evolution and conversion to TypeScript of till.mjs, equivalent written as plain ES6 module.
Install
With NPM
$ npm install tilly
or as development dependency:
$ npm install --save-dev tilly
With YARN
$ yarn add tilly
or as development dependency:
$ yarn add --dev tilly
Release Download
You can download and use the latest release directly from the GitHub page.
Usage
As TypeScript module
/// import specific methods or classes
import { all, sleep } from "tilly";
// ...
// or entire library
import * as tilly from "tilly";
// ...
As browser EcmaScript module
<script type="module">
/// import specific methods or classes
import { all, sleep } from "./tilly/esm/index.js";
// ...
// or entire library
import * as tilly from "./tilly/esm/index.js";
// ...
</script>
As commonjs/node.js module
/// import specific methods or classes
const { all, sleep } = require("tilly");
// ...
// or entire library
const tilly = require("tilly");
// ...
Documentation
Typedoc documentation with examples can be found by clicking here.
The same examples are visible by clicking here.
Build types available
This package is written in TypeScript and the build includes type definitions for use in other TypeScript projects.
The build of this package generates two versions:
- ES Module: For use in TypeScript or web projects for browsers that support ES6 modules. Using ES6 import in projects based on node.js (including TypeScript) it allows during the bundling phase (via webpack, rollup or equivalent) to perform the tree-shaking of the dependencies and have a lighter bundle.
- Universal Module Definition: To be used directly in projects based on node.js, or into web projects callable via global variable or via requirejs