Aigle
🦅 Aigle is an ideal promise library which is faster and more efficient than other libraries. It is a production-ready library that implements the Promise A+ standard.
Install / Use
/learn @suguru03/AigleREADME
Aigle is an ideal promise library which is faster and more efficient than other libraries. On top of being an impressive benchmark exercise, it is a production-ready library that implements the Promise A+ standard.
Also it has a lot of async style functions, you can start using Promise easily.
Usage
Node.js
npm install --save aigle
const Aigle = require('aigle');
const each = require('aigle/each');
TypeScript
import Aigle from 'aigle';
import { Aigle } from 'aigle';
Async/Await
global.Promise = Aigle;
async function getUsers(ids) {
const users = await Promise.map(ids, getUser);
const targets = await Promise.filter(users, filterUser);
return targets;
}
async function getUsers(ids) {
return await Promise.map(ids, getUser).filter(filterUser);
}
Convert synchronous functions to asynchronous functions
Aigle.mixin(require('lodash'));
return Aigle.map([1.1, 1.4, 2.2], (n) => Aigle.delay(10, n * 2)) // [2.2, 2.8, 4.4]
.uniqBy((n) => Aigle.delay(10, Math.floor(n))) // [2.2, 4.4]
.sum() // 6.6
.times() // [0, 1, 2, 3, 4, 5];
.then((value) => console.log(value)); // [0, 1, 2, 3, 4, 5];
browser
Recommend to use webpack, browserify, Rollup or any bundling tool.
or prebuilt scripts from here.
This will expose to global as window.Promise.
<script src="dist/aigle.min.js"></script>
window.Promise;
Functions
Core
prototype functions
class functions
Collections
prototype functions
concatconcatSeriesconcatLimiteacheachSerieseachLimiteveryeverySerieseveryLimitfilterfilterSeriesfilterLimitfindfindSeriesfindLimitfindIndexfindIndexSeriesfindIndexLimitfindKeyfindKeySeriesfindKeyLimitforEach->eachforEachSeries->eachSeriesforEachLimit->eachLimitgroupBygroupBySeriesgroupByLimitmapmapSeriesmapLimitmapValuesmapValuesSeriesmapValuesLimitomitomitSeries->omitBySeriesomitLimit->omitByLimitomitByomitBySeriesomitByLimitpickpickSeries->pickBySeriespickLimit->pickByLimitpickBypickBySeriespickByLimitreducereduceSeriesreduceLimitrejectrejectSeriesrejectLimitsomesomeSeriessomeLimitsortBysortBySeriessortByLimittransformtransformSeriestransformLimit
class functions
Promise.concatPromise.concatSeriesPromise.concatLimitPromise.eachPromise.eachSeriesPromise.eachLimitPromise.everyPromise.everySeriesPromise.everyLimitPromise.filterPromise.filterSeriesPromise.filterLimitPromise.findPromise.findSeriesPromise.findLimit- [
Promise.findIndex](https://suguru03.github.io/aigle/
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
