awilix 8.0.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -11
- package/lib/awilix.browser.js +1367 -1341
- package/lib/awilix.module.mjs +1549 -1535
- package/lib/awilix.umd.js +1367 -1341
- package/lib/container.d.ts +5 -5
- package/lib/container.js +1 -1
- package/lib/container.js.map +1 -1
- package/lib/errors.js.map +1 -1
- package/lib/function-tokenizer.d.ts +1 -1
- package/lib/function-tokenizer.js +5 -3
- package/lib/function-tokenizer.js.map +1 -1
- package/lib/injection-mode.d.ts +1 -1
- package/lib/lifetime.d.ts +1 -1
- package/lib/list-modules.d.ts +1 -1
- package/lib/load-module-native.js +2 -0
- package/lib/load-modules.d.ts +2 -2
- package/lib/load-modules.js +3 -2
- package/lib/load-modules.js.map +1 -1
- package/lib/param-parser.js +4 -2
- package/lib/param-parser.js.map +1 -1
- package/lib/resolvers.d.ts +5 -5
- package/lib/resolvers.js +5 -3
- package/lib/resolvers.js.map +1 -1
- package/lib/utils.d.ts +2 -2
- package/lib/utils.js +5 -3
- package/lib/utils.js.map +1 -1
- package/package.json +26 -28
package/README.md
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
# Awilix
|
|
2
2
|
|
|
3
|
-
[](https://gitter.im/awilix/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
4
3
|
[](https://www.npmjs.com/package/awilix)
|
|
5
|
-
[](https://david-dm.org/jeffijoe/awilix)
|
|
7
|
-
[](https://travis-ci.org/jeffijoe/awilix)
|
|
4
|
+
[](https://github.com/jeffijoe/awilix/actions/workflows/ci.yml)
|
|
8
5
|
[](https://coveralls.io/github/jeffijoe/awilix)
|
|
9
6
|
[](https://www.npmjs.com/package/awilix)
|
|
10
7
|
[](https://github.com/jeffijoe/awilix/blob/master/LICENSE.md)
|
|
11
8
|
[](https://www.npmjs.com/package/awilix)
|
|
12
9
|
[](http://standardjs.com/)
|
|
13
10
|
|
|
14
|
-
Extremely powerful **Dependency Injection** (DI) container for JavaScript/Node,
|
|
15
|
-
written in [TypeScript](http://typescriptlang.org).
|
|
11
|
+
Extremely powerful, performant, & battle-tested **Dependency Injection** (DI) container for JavaScript/Node,
|
|
12
|
+
written in [TypeScript](http://typescriptlang.org).
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
Awilix enables you to write **composable, testable software** using dependency injection **without special annotations**, which in turn decouples your core application code from the intricacies of the DI mechanism.
|
|
15
|
+
|
|
16
|
+
> 💡 Check out this
|
|
18
17
|
> [intro to Dependency Injection with Awilix](https://medium.com/@Jeffijoe/dependency-injection-in-node-js-2016-edition-f2a88efdd427)
|
|
19
18
|
|
|
20
19
|
# Table of Contents
|
|
@@ -53,7 +52,8 @@ written in [TypeScript](http://typescriptlang.org). **Make IoC great again!**
|
|
|
53
52
|
- [`container.build()`](#containerbuild)
|
|
54
53
|
- [`container.dispose()`](#containerdispose)
|
|
55
54
|
- [Universal Module (Browser Support)](#universal-module-browser-support)
|
|
56
|
-
|
|
55
|
+
- [Ecosystem](#ecosystem)
|
|
56
|
+
- [Contributing](#contributing)
|
|
57
57
|
- [What's in a name?](#whats-in-a-name)
|
|
58
58
|
- [Author](#author)
|
|
59
59
|
|
|
@@ -546,10 +546,10 @@ container.loadModules([
|
|
|
546
546
|
lifetime: Lifetime.SINGLETON,
|
|
547
547
|
// We can tell Awilix what to register everything as,
|
|
548
548
|
// instead of guessing. If omitted, will inspect the
|
|
549
|
-
// module to
|
|
549
|
+
// module to determine what to register as.
|
|
550
550
|
register: awilix.asClass
|
|
551
551
|
}
|
|
552
|
-
)
|
|
552
|
+
})
|
|
553
553
|
|
|
554
554
|
// We are now ready! We now have a userService, userRepository and emailService!
|
|
555
555
|
container.resolve('userService').getUser(1)
|
|
@@ -1346,7 +1346,15 @@ because they depend on Node-specific packages.
|
|
|
1346
1346
|
- Safari >= 10
|
|
1347
1347
|
- Internet Explorer is not supported
|
|
1348
1348
|
|
|
1349
|
-
|
|
1349
|
+
# Ecosystem
|
|
1350
|
+
|
|
1351
|
+
* [`awilix-manager`](https://github.com/kibertoad/awilix-manager): Wrapper that allows eager injection, asynchronous init methods and dependency lookup by tags.
|
|
1352
|
+
* [`awilix-express`](https://github.com/jeffijoe/awilix-express): Bindings for the Express HTTP library.
|
|
1353
|
+
* [`awilix-koa`](https://github.com/jeffijoe/awilix-koa): Bindings for the Koa HTTP library.
|
|
1354
|
+
* [`awilix-router-core`](https://github.com/jeffijoe/awilix-router-core): Library for building HTTP bindings for Awilix with routing.
|
|
1355
|
+
* [`fastify-awilix`](https://github.com/fastify/fastify-awilix): Bindings for the Fastify framework.
|
|
1356
|
+
|
|
1357
|
+
# Contributing
|
|
1350
1358
|
|
|
1351
1359
|
Please see our [contributing.md](./CONTRIBUTING.md)
|
|
1352
1360
|
|