# create-require

> Polyfill for Node.js module.createRequire (

Latest version **1.1.1** (published 2020-11-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install create-require
pnpm add create-require
yarn add create-require
bun add create-require
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2020-11-26 |
| First published | 2020-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Maintainers | pi0 |

## Links

- npm: https://www.npmjs.com/package/create-require
- Repository: https://github.com/nuxt-contrib/create-require
- Homepage: https://github.com/nuxt-contrib/create-require#readme
- Issues: https://github.com/nuxt-contrib/create-require/issues
- npm.io page: https://npm.io/package/create-require

## Recent versions

- 1.1.1 (latest) — 2020-11-26
- 1.1.0 — 2020-11-21
- 1.0.2 — 2020-06-12
- 1.0.1 — 2020-06-06
- 1.0.0 — 2020-05-25
- 0.0.1 — 2020-05-04
- 0.0.0 — 2020-05-04

## README

# `create-require`

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Github Actions][github-actions-src]][github-actions-href]
[![Codecov][codecov-src]][codecov-href]

Polyfill for Node.js [`module.createRequire`](https://nodejs.org/api/modules.html#modules_module_createrequire_filename) (<= v12.2.0)

## Install

```sh
yarn add create-require

npm install create-require
```

## Usage

```ts
function createRequire (filename: string | URL): NodeRequire;
```

```js
const createRequire = require('create-require')

const myRequire = createRequire('path/to/test.js')
const myModule = myRequire('./test-sibling-module')
```

## License

[MIT](./LICENSE)

<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/create-require?style=flat-square
[npm-version-href]: https://npmjs.com/package/create-require

[npm-downloads-src]: https://img.shields.io/npm/dm/create-require?style=flat-square
[npm-downloads-href]: https://npmjs.com/package/create-require

[github-actions-src]: https://img.shields.io/github/workflow/status/nuxt-contrib/create-require/test/master?style=flat-square
[github-actions-href]: https://github.com/nuxt-contrib/create-require/actions?query=workflow%3Atest

[codecov-src]: https://img.shields.io/codecov/c/gh/nuxt-contrib/create-require/master?style=flat-square
[codecov-href]: https://codecov.io/gh/nuxt-contrib/create-require

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