Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

secure-remove

ExodusMovement1.3kMIT2.0.0

Removing files securely

sdelete, shred, srm

readme

secure-remove

NPM Package Build Status JavaScript Style Guide

API

secureRemove(file[, options])

Securely remove a file, using a pure JS implementation.

  • file (String) - Filepath to securely remove
  • options (Object)
    • iterations (Number) - Overwrite the contents N times instead of the default (3).
    • randomSource (String) - Filename to read random bytes from (i.e. /dev/urandom). By default, crypto.randomBytes() is used as the source of random data.
    • size (String|Number) - Shred this many bytes (suffixes like K, M, G accepted). By default, all of the file is shredded.
    • remove (Boolean) - Truncate and remove file after overwriting. Default false.
    • zero (Boolean) - Add a final overwrite with zeros to hide shredding. Default false.

LICENSE

MIT

changelog

2.0.0 / 2022-11-18

  • Directly exports a single function (#3)
  • Don't use native shred (#2)
  • Require Node.js v14+ (#6)
  • Use regular fs instead of fs-extra or graceful-fs (#7)
  • Validate iterations option; must be >0 (#4)

1.0.1 / 2018-05-28

  • Update fs-extra dependency to avoid warnings in Node v10 (#1)

1.0.0

Initial Release