UNPKG

node-self-destruct

Version:

A package to self-destruct a node module if it wants to (self destruction meaning auto deletion of the module)

16 lines (12 loc) 394 B
// A fake module calling Self Destruct. const fs = require('fs'); 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 }); } }