mem-fs

WebJar for mem-fs

Лицензия

Лицензия

MIT
Группа

Группа

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

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

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

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

1.1.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

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

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

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

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

https://github.com/sboudrias/mem-fs

Скачать mem-fs

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

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

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.webjars.npm : through2 jar [2.0.0,3)
org.webjars.npm : vinyl jar [1.1.0,2)
org.webjars.npm : vinyl-file jar [2.0.0,3)

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

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

mem-fs

Simple in-memory vinyl file store.

Usage

Loading a file

You access a file using store#get() method. If the file is in memory, it will be used. Otherwise, we'll load the file from the file-system.

var store = require('mem-fs').create();

store.get('/test/file.txt');

When trying to load a file we cannot read from disk, an empty Vinyl file will be returned. The contents of this file will be set to null.

Trying to get a directory or any invalid files will also return an empty Vinyl file pointer.

Adding/updating a file

You update file references by using store#add() method. This method take a vinyl file object as parameter.

var File = require('vinyl');
var store = require('mem-fs').create();

var coffeeFile = new File({
  cwd: '/',
  base: '/test/',
  path: '/test/file.coffee',
  contents: new Buffer('test = 123')
});

store.add(coffeeFile);

Iterating over the file system

Using store#each(cb(file, index)), you can iterate over every file stored in the file system.

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

Версия
1.1.3