1.0.6 • Published 5 months ago

nodejs-os-scripting-framework v1.0.6

Weekly downloads
-
License
WTFPL
Repository
github
Last release
5 months ago

nodejs-os-scripting-framework

The Node.js OS Scripting Framework is a kit of utilities and packages to write Node.js-based scripts for the operative system.

Installation

npm install --save nodejs-os-scripting-framework

Explanation

This package is a unification of some of the most used utilities in Node.js when writting scripts for the operative system. One by one, their reason to be part of this package are:

  • adm-zip: to zip and unzip files.
  • chalk: to print colors by console.
  • cli-table: to print tables by console.
  • download: to download files from the net.
  • fs-extra: to carry complex filesystem operations easily.
  • globby: to find files by glob patterns.
  • inquirer: to have a kit of complex user inputs.
  • readline-sync: to ask user for inputs.
  • spinnies: to show spinners easily.
  • which: to find executables in the system, or not.
  • xlsx: to read and write Excel files.

Dependencies

The dependencies are the following:

  "adm-zip": "^0.5.10",
  "chalk": "^5.3.0",
  "download": "^8.0.0",
  "fs-extra": "^11.2.0",
  "globby": "^14.0.0",
  "inquirer": "^9.2.12",
  "readline-sync": "^1.4.10",
  "spinnies": "^0.5.1",
  "which": "^4.0.0",
  "xlsx": "^0.18.5"

References

The references of the included packages are on:

Usage

To use any of these packages, you can directly:

const nosf = require("nodejs-os-scripting-framework");
await nosf.load(); // Esta línea normaliza los imports de algunos paquetes
const {
  admZip,
  chalk,
  cliTable
  download,
  fsExtra,
  globby,
  inquirer,
  readlineSync,
  spinnies,
  which,
  xlsx,
} = nosf;

You can find also the functions:

  • nosf.executeSync(command, options)
  • nosf.executeAsync(command, options)
  • await nosf.findFilesAsync(glob_pattern)
  • await nosf.dumpToExcel(file, array_of_objects)

Tests

Take a look to the test/test.js file to see them in action in a fast mocha test.

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago