Last active
April 3, 2020 15:05
-
-
Save aakashlpin/82c4b49e009b00ece932ee54d0642dcd to your computer and use it in GitHub Desktop.
This file contains 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
#!/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)); |
This file contains 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
{ | |
"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