A package to self-destruct a node module if it wants to (self destruction meaning auto deletion of the module)
npm install node-self-destructnpm i node-self-destruct`
Usage example
`js
const SelfDestruct = require('../self-destruct/destruct.js');
// do something that causes a self destruct.
module.exports = class Fake {
static init () {
console.log("Self destructing...");
SelfDestruct.destroy("You are not allowed to use this module!", {
changePackageFile: true
});
}
}
`
Options
$3
- message: The message to display before the module is removed.
$3
- changePackageFile`: If true, the package.json file will be changed to remove the module. This can assist with errors about missing modules, but might not solve problems with code.