0.0.1 • Published 6 months ago

copyguard v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

copyguard

copyguard utilitas sederhana untuk menyalin file dengan aman dan fleksibel

Mendukung operasi penyalinan dasar dan fitur keamanan untuk mencegah penimpaan file yang tidak disengaja.

Instalasi

npm install copyguard

API

copyFileSafely(source: string, destination: string): Promise<void>

Salin file dari lokasi sumber ke tujuan.

  • source: Path ke file sumber.
  • destination: Path tujuan untuk menyalin file.
// ESM
import { copyguard } from 'copyguard'

await copyguard.copyFileSafely('source.txt', 'destination.txt')
// CommonJS
const { copyguard } = require('copyguard')

copyguard.copyFileSafely('source.txt', 'destination.txt')

copyFileWithExcl(source: string, destination: string): Promise<void>

Salin file dengan aman menggunakan constants.COPYFILE_EXCL.

  • source: Path ke file sumber.
  • destination: Path tujuan untuk menyalin file.
// ESM
import { copyguard } from 'copyguard'

await copyguard.copyFileWithExcl('source.txt', 'destination.txt')
// CommonJS
const { copyguard } = require('copyguard')

copyguard.copyFileWithExcl('source.txt', 'destination.txt')