# polywrath

> Include JavaScript polyfills ([core-js](https://github.com/zloirock/core-js)) based on usage and wanted browsers ([browserslist](https://github.com/browserslist/browserslist)).

Latest version **1.1.1** (published 2018-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install polywrath
pnpm add polywrath
yarn add polywrath
bun add polywrath
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-04-17 |
| First published | 2018-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 10 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | independentgeorge |

## Links

- npm: https://www.npmjs.com/package/polywrath
- Repository: https://github.com/independentgeorge/polywrath
- Homepage: https://github.com/independentgeorge/polywrath#readme
- Issues: https://github.com/independentgeorge/polywrath/issues
- npm.io page: https://npm.io/package/polywrath

## Dependencies (3)

- [core-js](https://npm.io/package/core-js.md) 2.5.5
- [@babel/core](https://npm.io/package/@babel/core.md) 7.0.0-beta.44
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) 7.0.0-beta.44

## Recent versions

- 1.1.1 (latest) — 2018-04-17
- 1.1.0 — 2018-04-17
- 1.0.0 — 2018-04-15

## README

# polywrath

Include JavaScript polyfills ([core-js](https://github.com/zloirock/core-js)) based on usage and wanted browsers ([browserslist](https://github.com/browserslist/browserslist)).


```javascript
const polyfills = require("polywrath")({
   contents: "alert(typeof Symbol)",  // String(s) to scan. Optional if .src set.
   src: "source.js",                  // Path(s) to scan. Optional if .contents set.
   dest: "polyfills.js",              // Synchronously output to file. Optional.
   browsers: "ie > 9",                // Browserslist query.
   exclude: ["es6.symbol"],           // Polyfills from `core-js/modules/` not to include. Optional.
   module: "cjs",                     // Module format; "es" or "cjs" (default).
   root: "../.."                      // Relative path to directory with node_modules. Defaults to ".".
})
```
```javascript
// source.js
Promise.resolve(Symbol())
```

```javascript
// polyfills.js
require("../../node_modules/core-js/modules/es6.symbol");
require("../../node_modules/core-js/modules/es6.promise");
```


-----

The entire code is transformed with [babel 7](http://new.babeljs.io/docs/en/babel-preset-env.html), polyfills are extracted and everything else dismissed.

The package is shipped with `core-js`.

---
_Source: https://npm.io/package/polywrath · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
