Skip to content

Instantly share code, notes, and snippets.

@aakashlpin
Last active April 3, 2020 15:05
Show Gist options
  • Save aakashlpin/82c4b49e009b00ece932ee54d0642dcd to your computer and use it in GitHub Desktop.
Save aakashlpin/82c4b49e009b00ece932ee54d0642dcd to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
const args = require('yargs').argv;
function performfn(input) {
const numbers = input.match(/[+-]?\d+(?:\.\d+)?/g).map(Number);
return numbers;
}
console.log(args.inputstr);
console.log(performfn(args.inputstr));
{
"name": "numbers from string",
"version": "1.0.0",
"bin": "./index.js",
"dependencies": {
"yargs": "^15.3.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment