care-js-bundle
Donation ETH 0x8F36c9066435c52053bf4447Cbd837e14ABaf403
Modular standard library for JavaScript. Includes polyfills for ECMAScript up to 2019: promises, symbols, collections, iterators, typed arrays, many other features, ECMAScript proposals, some cross-platform WHATWG / W3C features and proposals like URL
. You can load only required features or use it without global namespace pollution.
Example:
import 'care-js';
Array.from(new Set([1, 2, 3, 2, 1]));
[1, [2, 3], [4, [5]]].flat(2);
Promise.resolve(32).then(x => console.log(x));
You can load only required features:
import 'care-js/features/array/from';
import 'care-js/features/array/flat';
import 'care-js/features/set';
import 'care-js/features/promise';
Array.from(new Set([1, 2, 3, 2, 1]));
[1, [2, 3], [4, [5]]].flat(2);
Promise.resolve(32).then(x => console.log(x));
Or use it without global namespace pollution:
import from from 'care-js-pure/features/array/from';
import flat from 'care-js-pure/features/array/flat';
import Set from 'care-js-pure/features/set';
import Promise from 'care-js-pure/features/promise';
from(new Set([1, 2, 3, 2, 1]));
flat([1, [2, 3], [4, [5]]], 2);
Promise.resolve(32).then(x => console.log(x));
It's a bundled global version, for more info see care-js
documentation.