Skip to content

Instantly share code, notes, and snippets.

@tcdw
Last active July 7, 2016 00:39
Show Gist options
  • Select an option

  • Save tcdw/e59d68f1b8ef7e709766141d447f4cf6 to your computer and use it in GitHub Desktop.

Select an option

Save tcdw/e59d68f1b8ef7e709766141d447f4cf6 to your computer and use it in GitHub Desktop.
Illegal Alphabet Checker
#!/usr/bin/env node
var content = process.argv[process.argv.length - 1];
if (content == process.title) {
console.log("Usage: " + process.title + " <content>");
process.exit();
} else {
var illegalAlphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
illegalAlphabet.forEach(function(alphabet) {
if (content.indexOf(alphabet) != -1) {
console.error("Error! Found illegal alphabet " + alphabet);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment