Notwithstanding Precautions, Misadventure
Miss any of our Open RFC calls?Watch the recordings here! »

inject3

1.0.0 • Public • Published

inject3

Inject a dependency (service locator pattern).

USAGE

// app.ts
import { inject } from 'inject3';
const fs = inject('fs', () => require('fs'));
fs.readFileSync('data.json');
 
// app.spec.ts
import { injector } from 'inject3';
injector.mock('fs', () => ({ readFileSync: () => 'result of call of fs.readFileSync()' }));

CHANGELOG

See CHANGELOG

Install

npm i inject3

DownloadsWeekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

10.3 kB

Total Files

10

Last publish

Collaborators

  • avatar