Skip to content
/ nosf Public

Kit of packages and utilities to write scripts in Node.js. NOSF stands for «Node.js OS Scripting Framework».

Notifications You must be signed in to change notification settings

allnulled/nosf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Kit of packages and utilities to write scripts in Node.js. NOSF stands for «Node.js OS Scripting Framework».

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published