digitfy
Extract numbers from the file or string.
Last updated 25 days ago by urbanishimwe .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install digitfy 
SYNC missed versions from official npm registry.

Digitfy

License: MIT Build Status

Digitfy extract numbers, integers, octals, binaries, hexadecimals and unicode code points from the file or string.

               ***************
            **                ** 
            **                **
            **                **
            **                **
            **                **
            **                **
               ***************
            **                **
            **                **
            **                **
            **                **
            **                **
            **                **
            **                **
              ***************
  • GLOABLLY

npm install -g digitfy

USAGE:

help

digitfy --help

command

digitfy --file file1.txt -f file2.txt --str "string1" -s "string2" --num --int -o -x --hex

output

hex
...
...
num
...
...
int
...
... etc..
  • AS A LIBRARY

npm i digitfy, yarn add digitfy

USAGE:

  • getInt returns non-floating integers e.g. -1, 1, 100 ....
  • getNum returns numbers e.g 1e-4, 1, 100, 100e12, 12,89
  • getBin returns parsed binary numbers, e.g. "111 hello 011" will return [7, 3]
  • getOct returns parsed octal numbers
  • getHex returns parsed hexadecimal numbers
  • getUni returns plain unicode code points e.g. U+12348

The syntax to extract from files [function]F(path_to_the_utf8_file) e.g. getHexF("number.txt")

const 
  digit = require('digitfy'),
  str = "I have 0xc pancakes in my 14$ bag"
;

console.log(digit.getHex(str).concat(digit.getOct(str))) // [12, 12]

Note: the limit to parse non-decimal numbers(bin, oct, hex) is 64-bit largest int

Contribution

???? fork this repository and raise a PR, or create an issue ????

Current Tags

  • 1.3.1                                ...           latest (25 days ago)

4 Versions

  • 1.3.1                                ...           25 days ago
  • 1.3.0                                ...           a month ago
  • 1.2.0                                ...           2 months ago
  • 1.0.0                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 24
Dependencies (0)
None
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |