node-global-tool

1.1.4 • Public • Published

node-global-tool

Tools developed using Node which is for CLI use.

Tools:

  • check-memory Check memory of node v8
  • test-mysql Test MySQL connection
  • test-pg Test Postgresql connection
  • now now Display current time
  • rand rand Generate random float number
  • rand-int rand-int Generate random integer number
  • CRLF Check or set file if it contains LF/CR/CRLF.

Usage:

check-memory

ngt check-memory

Check memory of node v8 via heapStatistics

Example output

Default max-old-space-size: 4144 MB
{
  "total_heap_size": 17649664,
  "total_heap_size_executable": 524288,
  "total_physical_size": 17649664,
  "total_available_size": 4336030704,
  "used_heap_size": 9011528,
  "heap_size_limit": 4345298944,
  "malloced_memory": 524432,
  "peak_malloced_memory": 1042088,
  "does_zap_garbage": 0,
  "number_of_native_contexts": 2,
  "number_of_detached_contexts": 0,
  "total_global_handles_size": 8192,
  "used_global_handles_size": 2592,
  "external_memory": 2021759
}

test-mysql

Test MySQL connection string.

ngt test-mysql mysql://derek:xxxxxx@localhost/db1

test-pg

Test postgresql connection string. Server must use SSL.

ngt test-pg postgres://postgres:xxxxxxxx@localhost/postgres

now

Show current date and time

ngt now

rand

Generate random float number with min value and max value

minValue <= output < maxValue

ngt rand
ngt rand 1 100

rand-int

Generate random integer number with min value and max value

minValue <= output < maxValue

ngt rand-int
ngt rand-int 1 100

CRLF

Check or set file if it contains LF/CR/CRLF.

Check if it contains LF/CR/CRLF.

ngt crlf fish.txt

Set file as LF.

ngt crlf fish.txt lf

Set file as CR.

ngt setcr fish.txt cr

Set file as CRLF.

ngt crlf fish.txt crlf

Setup

npm install -g node-global-tool

Test

ngt check-memory

Readme

Keywords

Package Sidebar

Install

npm i node-global-tool

Weekly Downloads

7

Version

1.1.4

License

MIT

Unpacked Size

24.3 kB

Total Files

20

Last publish

Collaborators

  • cityuderek