Skip to content

Instantly share code, notes, and snippets.

View wibbuffey's full-sized avatar
🐢
existing

wibbuffey

🐢
existing
View GitHub Profile
@wibbuffey
wibbuffey / parse.js
Last active October 18, 2021 15:11
[[ MOVED ]] simple command line parser in node.js
// moved: github.com/ShinyWobbuffet/nsfp
function parse (array, registry) {
const flags = []
const other = []
array.forEach((item, index) => {
if (item.startsWith("--")) {
flags.push(item.slice(2))
} else if (item.startsWith("-")) {
if (registry[item.slice(1)]) {