num-only
v1.1.1
Published
Function to stringify and remove non-numeric characters of items.
Downloads
546
Maintainers
Readme
num-only
Node package with a function to stringify and remove non-numeric characters of items.
Browser Support
| | | | | | --- | --- | --- | --- | --- | --- | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
Installation
$ npm install num-only
Import
// ES Modules
import numOnly from 'num-only'
// Common JS
const numOnly = require('num-only')
or import it through your HTML file, using CDN:
<script src="https://cdn.jsdelivr.net/npm/num-only@latest/dist/num-only.min.js"></script>
Usage
numOnly('12345') // returns '12345'
numOnly('abc123') // returns '123'
numOnly(['a', 'b', 'c', 1, 2, 3]) // returns '123'
numOnly(true) // returns ''
numOnly(() => 5 + 3) // returns '53'