destroy

WebJar for destroy

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

destroy
Последняя версия

Последняя версия

1.0.4
Дата

Дата

Тип

Тип

jar
Описание

Описание

destroy
WebJar for destroy
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/stream-utils/destroy

Скачать destroy

Имя Файла Размер
destroy-1.0.4.pom
destroy-1.0.4.jar 3 KB
destroy-1.0.4-sources.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/destroy/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>destroy</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/destroy/
implementation 'org.webjars.npm:destroy:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.npm/destroy/
implementation ("org.webjars.npm:destroy:1.0.4")
'org.webjars.npm:destroy:jar:1.0.4'
<dependency org="org.webjars.npm" name="destroy" rev="1.0.4">
  <artifact name="destroy" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='destroy', version='1.0.4')
)
libraryDependencies += "org.webjars.npm" % "destroy" % "1.0.4"
[org.webjars.npm/destroy "1.0.4"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Destroy

NPM version Build status Test coverage License Downloads

Destroy a stream.

This module is meant to ensure a stream gets destroyed, handling different APIs and Node.js bugs.

API

var destroy = require('destroy')

destroy(stream)

Destroy the given stream. In most cases, this is identical to a simple stream.destroy() call. The rules are as follows for a given stream:

  1. If the stream is an instance of ReadStream, then call stream.destroy() and add a listener to the open event to call stream.close() if it is fired. This is for a Node.js bug that will leak a file descriptor if .destroy() is called before open.
  2. If the stream is not an instance of Stream, then nothing happens.
  3. If the stream has a .destroy() method, then call it.

The function returns the stream passed in as the argument.

Example

var destroy = require('destroy')

var fs = require('fs')
var stream = fs.createReadStream('package.json')

// ... and later
destroy(stream)
org.webjars.npm

Версии библиотеки

Версия
1.0.4
1.0.3