Socket
Socket
Sign inDemoInstall

axx

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    axx

async shell exec, streams, piping


Version published
Weekly downloads
5
decreased by-37.5%
Maintainers
1
Install size
22.2 kB
Created
Weekly downloads
 

Readme

Source

axx

  • execution of shell commands
  • async/await functionality for easy concurrency control
  • streaming, proper piping

npm install axx

require("axx")

lean functions

  • axx — run shell command
  • raxx — read from file
  • waxx — write to file
  • caxx — log to stdout (the console)

memory-hog functions

  • maxx — same as axx, but returns the full stdout result
  • mraxx — same as raxx, but returns the whole file to result

examples


const {axx, raxx, waxx} = require("axx")

const n = `$(npm bin)` // "node_modules/.bin"

async function build() {

	// minify a script
	await
	raxx(`myscript.js`,
		axx(`${n}/uglifyjs --compress --mangle`,
			waxx(`myscript.min.js`)
		)
	)

	// run a few concurrent operations, wait for them all to complete
	await Promise.all([
		axx(`${n}/tsc`),
		axx(`cat src/a src/b`, waxx(`dist/c`)),
		axx(`${n}/node-sass --source-map true src/s.scss dist/s.css`)
	])

	console.log("✔ done build")
}

some more contrived examples


// log the package.json to the console just so i can see it
await raxx(`package.json`, caxx())

// alternative (memory-hog) way to log to the console
const text = await mraxx(`LICENSE.txt`)
console.log(text)

Keywords

FAQs

Last updated on 04 May 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc