fs-mkdirp-stream

WebJar for fs-mkdirp-stream

Лицензия

Лицензия

MIT
Группа

Группа

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

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

fs-mkdirp-stream
Последняя версия

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

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

fs-mkdirp-stream
WebJar for fs-mkdirp-stream
Ссылка на сайт

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

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

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

https://github.com/gulpjs/fs-mkdirp-stream

Скачать fs-mkdirp-stream

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

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

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : graceful-fs jar [4.1.11,5)
org.webjars.npm : through2 jar [2.0.3,3)

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

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

fs-mkdirp-stream

NPM version Downloads Build Status Coveralls Status

Ensure directories exist before writing to them.

Usage

var to = require('to2');
var from = require('from2');
var mkdirpStream = require('fs-mkdirp-stream');

from
  .obj([{ dirname: '/path/to/my/', path: '/path/to/my/file.js' }])
  .pipe(
    mkdirpStream(function (obj, callback) {
      // callback can take 3 arguments (err, dirname, mode)
      callback(null, obj.dirname);
    })
  )
  .pipe(
    to.obj(function (obj) {
      // This will be called once the directory exists
      // obj === { dirname: '/path/to/my/', path: '/path/to/my/file.js' }
    })
  );

API

mkdirpStream(resolver)

Takes a resolver function or string and returns a streamx.Transform stream.

If the resolver is a function, it will be called once per chunk with the signature (chunk, callback). The callback(error, dirpath, mode) must be called with the dirpath to be created as the 2nd parameter or an error as the 1st parameter; optionally with a mode as the 3rd parameter.

If the resolver is a string, it will be created/ensured for each chunk (e.g. if it were deleted between chunks, it would be recreated). When using a string, a custom mode can't be used.

License

MIT

Contains a custom implementation of mkdirp originally based on https://github.com/substack/node-mkdirp (Licensed MIT/X11 - Copyright 2010 James Halliday) with heavy modification to better support custom modes.

org.webjars.npm

gulp

A toolkit to automate & enhance your workflow

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

Версия
1.0.0