JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q55319F
  • License Apache-2.0

Ponyfills are provided as modules, which deliver native functions first if available

Package Exports

  • ponyfills
  • ponyfills/lib/assign

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ponyfills) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ponyfills

npm version npm download dependencies license

What is the Ponyfills?

Ponyfills provides a set of modules, which work natively in modern node.js runtime and modern browsers, however, it needs extra fallback code in order to run in some environments.

It simply tests the availability of native functionality first, then delivers the closest/best alternative implementation if native ones are not available.

Compared to its alternatives, ponyfills doesn't assign its modules anywhere or doesn't patch anything in the runtime environment. Instead, it just delivers the required functionality with ES6 modules or commonjs.

Plus, as a library, Ponyfills is completely tree-shanking-friendly. Your favorite module bundler can easily inline the functionality you need with no extra configuration, instead of bundling the whole Ponyfills package.

Quick start

Execute npm install ponyfills to install ponyfills and its dependencies into your project directory.

Usage

For example, to ensure Object.assign's availability:

import { assign } from 'ponyfills';

const test = assign({}, { test: true });

console.log(`Result: ${test}`);
console.log(`Is Native: ${assign === Object.assign}`);

Alternative usage I:

import * as ponyfills from 'ponyfills';

const test = ponyfills.assign({}, { test: true });

Alternative usage II:

import assign from 'ponyfills/lib/assign';

const test = assign({}, { test: true });

List of modules

Todo List

See GitHub Projects for more.

Requirements

License

Apache 2.0, for further details, please see LICENSE file

Contributing

See contributors.md

It is publicly open for any contribution. Bugfixes, new features and extra modules are welcome.

  • To contribute to code: Fork the repo, push your changes to your fork, and submit a pull request.
  • To report a bug: If something does not work, please report it using GitHub Issues.

To Support

Visit my patreon profile at patreon.com/eserozvataf