# @blowback/contextify

> Creates a contextualized copy of node require

Latest version **1.0.2** (published 2021-12-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @blowback/contextify
pnpm add @blowback/contextify
yarn add @blowback/contextify
bun add @blowback/contextify
```

## 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.0.2 |
| Published | 2021-12-13 |
| First published | 2021-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | antoniopresto |
| Maintainers | antonio.presto |
| Keywords | module, vm, require, context, provider, contextify, contextualized |

## Links

- npm: https://www.npmjs.com/package/@blowback/contextify
- npm.io page: https://npm.io/package/@blowback/contextify

## Dependencies (1)

- [builtin-modules](https://npm.io/package/builtin-modules.md) 3.2.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-12-13
- 1.0.1 — 2021-12-13

## README

# Blowback

## Contextify

Creates a contextualized copy of node `require`

```ts
// ./tasks/module1.js
const getContext = require('my-context-module');

module.exports = () => {
  return getContext().myContextValueABC;
};

// index.js
import { Contextify } from 'blowback';
const { prepareRequire } = new Contextify({
  contextModuleName: 'my-context-module',
});

const require = prepareRequire({
  currentDirname: __dirname + '/tasks',
  payload: { myContextValueABC: 'abc321' },
});

const contextified = require('./module1');
console.log(contextified()); // -> abc321
```

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