Package Exports
- secure-rm
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (secure-rm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Completely erases files by making recovery impossible.
❓ Why
When you delete a file using the rm command or fs.unlink in node, it only removes direct pointers to the data disk sectors and make the data recovery possible with common software tools.
Permanent data erasure goes beyond basic file deletion commands, which:
- Allow for selection of a specific standard, based on unique needs,
- Verify the overwriting method has been successful and removed data across the entire device.
📦 Installation
npm install secure-rmLooking for a command line interface? Click here.
🚀 Getting started
If you want your application to delete specific files with a pass of cryptographically strong pseudo-random data, use one of these code snippets:
Callback version
const srm = require('secure-rm')
srm('./folder/*.js', (err) => {
if (err) throw err
console.log('Files successfully deleted !')
})Promise version
const srm = require('secure-rm')
srm('./folder/*.js')
.then(() => console.log('Files successfully deleted !'))
.catch((err) => {throw err})📚 Usage
Visit the wiki to discover all the possibilities secure-rm offers!
- 📚 Choose a standard
- ⚙️ Customize your standard
- 📗 Unlink Methods
- 📙 RmDir Methods
- ✨ Respond to events
- 🚩 Troubleshooting - Common issues
Examples:
const options = {
standard: 'gutmann',
maxBusyTries: 5,
disableGlob: true
}
srm('./data/*.js', options, (err) => {
if (err) throw err
console.log('Files successfully deleted !')
})
srm('./trash/dir/', { standard: 'preview' }, (err, fileTree) => {
if (err) throw err
console.log('Files that would be deleted:' + fileTree)
})
📜 Changelog / History
See the changelog or releases.
📌 TODO
- Implement more tests
- Support of 64bit files
🏗 Contributing
Licensing
This project is under MIT License.