DecentInjection:为 DecentCMS 构建和使用的依赖注入库

时间:2021-06-03 09:52:32
【文件属性】:
文件名称:DecentInjection:为 DecentCMS 构建和使用的依赖注入库
文件大小:19KB
文件格式:ZIP
更新时间:2021-06-03 09:52:32
JavaScript Decent Injection 提供了一个作用域对象,用于管理服务,然后可以使用“需要”样式的服务定位器 API、构造函数注入或属性注入将这些服务注入到其他服务中。 它没有外部运行时依赖。 入门 Scope API 的完整文档可以在以下位置找到: 安装包 要安装该软件包,请执行npm install decent-injection --save 。 创建范围 作用域是一种可以应用于现有对象的混合。 例如,可以“范围化”来自 Express 中间件的请求: app . get ( '/foo/bar' , function ( req , res , next ) { var scope = require ( 'decent-injection' ) ; scope ( 'request' , req ) ; // ... Do stuff next ( ) ;
【文件预览】:
DecentInjection-master
----.gitignore(533B)
----test()
--------index.js(13KB)
----LICENSE(1KB)
----Gruntfile.js(468B)
----package.json(873B)
----readme.md(19KB)
----index.js(144B)
----doc()
--------scope-api.md(10KB)
----lib()
--------scope.js(14KB)

网友评论