GithubHelp home page GithubHelp logo

mcfrank16 / digitfy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from urbanishimwe/digitfy

1.0 0.0 0.0 168 KB

Extract numbers from the file or string.

License: MIT License

JavaScript 100.00%

digitfy's Introduction

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 ๐Ÿ”ฅ

digitfy's People

Contributors

dependabot[bot] avatar nkalyesubula avatar

Stargazers

Frank C. Mutabazi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.