https://github.com/exodusmovement/secure-remove
Removing files securely
https://github.com/exodusmovement/secure-remove
Last synced: 9 months ago
JSON representation
Removing files securely
- Host: GitHub
- URL: https://github.com/exodusmovement/secure-remove
- Owner: ExodusMovement
- License: mit
- Created: 2016-08-29T09:59:05.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2025-05-20T13:30:23.000Z (about 1 year ago)
- Last Synced: 2025-08-09T15:45:21.862Z (10 months ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 7
- Watchers: 29
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# secure-remove
[](https://www.npmjs.org/package/secure-remove)
[](https://github.com/ExodusMovement/secure-remove/actions?query=branch%3Amaster)
[](https://standardjs.com)
## 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()`](https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback) 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