Acme.BookStore.HttpApi.Host/node_modules/undertaker-registry/README.md
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<p align="center">
<a href="http://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>
# undertaker-registry
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
Default registry in gulp 4.
## Usage
```js
var gulp = require('gulp');
var UndertakerRegistry = require('undertaker-registry');
var registry = new UndertakerRegistry();
gulp.registry(registry);
```
## API
### new UndertakerRegistry([options])
Constructor for the default registry. Inherit from this constructor to build custom registries.
### init(taker)
No-op method that receives the undertaker instance. Useful to set pre-defined tasks using the
`undertaker.task(taskName, fn)` method. Custom registries can override this method when inheriting
from this default registry.
### get(taskName) => Function
Returns the task with that name or undefined if no task is registered with that name. Useful for custom
task storage. Custom registries can override this method when inheriting from this default registry.
### set(taskName, fn) => [Function]
Adds a task to the registry. If `set` modifies a task, it should return the new task so Undertaker can
properly maintain metadata for the task. Useful for adding custom behavior to every task as it is
registered in the system. Custom registries can override this method when inheriting from this default
registry.
### tasks() => Object
Returns an object listing all tasks in the registry. Necessary to override if the `get` method is overridden
for custom task storage. Custom registries can override this when when inheriting from this default
registry.
## Custom Registries
Custom registries are constructor functions allowing you to pre-define/share tasks
or add custom functionality to your registries.
A registry's prototype should define:
后面还有 150 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
