0.2.0 • Published 6 years ago

axx v0.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

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)
0.2.0

6 years ago

0.2.0-dev.0

6 years ago

0.1.1-dev.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago

0.0.1-dev.0

6 years ago

0.0.0

6 years ago

0.0.0-dev.5

6 years ago