NPM:
npm i remove-dupl --save
Yarn:
yarn add remove-dupl
const { removeFromArray, removeFromFile } = require("remove-dupl");
const newArr = removeFromArray([1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0]);
const count = removeFromFile("PATH_TO_FILE", "PATH_TO_NEW_FILE");
If the path to the new file is empty, it will overwrite the original file.
MIT © Joyent, Inc. and other Node contributors