Created
August 18, 2016 22:06
-
-
Save BerkeleyTrue/ddf1f0b03152700a2019c696e22f281c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| var emailName = process.argv[2]; | |
| var percent = process.argv[3]; | |
| var emails = require('./' + emailName + '.json'); | |
| var newEmails = emails.slice((emails.length * (percent / 100))); | |
| console.log( | |
| 'Do emails end the same? %s', | |
| emails[emails.length - 1] === newEmails[newEmails.length -1] | |
| ); | |
| console.log('Original email list size: %s', emails.length); | |
| console.log('New Email list size: %s', newEmails.length); | |
| fs.writeFileSync('./emails.json', JSON.stringify(newEmails)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment