Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qqjs

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qqjs

useful functions for writing node scripts

  • 0.3.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
58K
decreased by-9.71%
Maintainers
1
Weekly downloads
 
Created
Source

qqjs

A bunch of wrappers for various utilites. Ideal for writing shell scripts in node.

Version CircleCI Appveyor CI Codecov Greenkeeper Known Vulnerabilities Downloads/week License

Usage

It's best to look at the code to see what all is available, but here is an example of using it:

const qq = require('qqjs')

// qq.run(fn) is just fn().catch(qq.handleError)
// this helps skip a couple of steps when running async functions in scripts
qq.run(async () => {
  // turn silent mode to log all commands
  // can also see output with DEBUG=qq
  // qq.config.silent = false

  // run a command with qq.x this runs synchronously using execa
  // by default it will echo out to the screen the commmand, stdout/stderr and connect to stdin
  // can send either a string
  await qq.x('git --version')

  // or specify the arguments
  await qq.x('git' ['--version'])

  await qq.cd('newdir')

  await qq.cp('from', 'to')

  const pjson = await qq.readJSON('package.json')
  await qq.writeJSON('package.json', {})

  // for almost any command, if it takes a string you can also pass an array and it will automatically path.join()
  await qq.writeJSON(['mydir', 'package.json'], {})
})

Status

  • x (exec)
  • readJSON
  • writeJSON
  • path
  • mkdirp
  • env
  • globby
  • read file
  • write file
  • cd
  • ls
  • cp (use cpy)
  • mv
  • rm
  • cwd
  • file exists
  • homedir
  • chmod
  • download files
  • emptyDir
  • ln
  • is file/directory/symlink/etc
  • batch rename
  • sed
  • upload files
  • aws s3
  • resolve-from
  • open-editor
  • hasha
  • temp dirs
  • temp files
  • git stuff?
  • find-up
  • read-pkg
  • which
  • pushd/popd

Keywords

FAQs

Package last updated on 10 May 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc