fs-copy-file-sync

WebJar for fs-copy-file-sync

Лицензия

Лицензия

MIT
Группа

Группа

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

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

fs-copy-file-sync
Последняя версия

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

1.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

fs-copy-file-sync
WebJar for fs-copy-file-sync
Ссылка на сайт

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

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

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

https://github.com/coderaiser/fs-copy-file-sync

Скачать fs-copy-file-sync

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

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

Зависимости

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

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

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

fs-copy-file-sync License NPM version Dependency Status Build Status Coverage Status

Node.js v8.5.0 fs.copyFileSync ponyfill.

Synchronously copies src to dest. By default, dest is overwritten if it already exists. Returns undefined. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination.

Install

npm i fs-copy-file-sync

API

flags is an optional integer that specifies the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE).

  • fs.constants.COPYFILE_EXCL - The copy operation will fail if dest already exists.
  • fs.constants.COPYFILE_FICLONE - The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then a fallback copy mechanism is used.
  • fs.constants.COPYFILE_FICLONE_FORCE - The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then the operation will fail.

Example:

const copyFileSync = require('fs-copy-file-sync');

// destination.txt will be created or overwritten by default.
copyFileSync('source.txt', 'destination.txt');
console.log('source.txt was copied to destination.txt');

If the third argument is a number, then it specifies flags, as shown in the following example.

const copyFileSync = require('fs-copy-file-sync');
const { COPYFILE_EXCL } = copyFileSync.constants;

// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.
fs.copyFileSync('source.txt', 'destination.txt', COPYFILE_EXCL);

Related

License

MIT

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

Версия
1.1.1