[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[TXT]CHANGELOG.md2024-05-21 17:04 1.3K 
[   ]LICENSE2024-05-21 17:04 1.1K 
[TXT]create-require.d.ts2024-05-21 17:04 105  
[   ]create-require.js2024-05-21 17:04 1.2K 
[TXT]README.md2024-05-21 17:04 1.4K595aea1 more query options + view options [كارل مبارك]
[   ]package.json2024-05-21 17:04 1.0Kafd0ccc remove unused [كارل مبارك]
# `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