GithubHelp home page GithubHelp logo

qqjs's Introduction

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

qqjs's People

Contributors

jdx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

g-rath

qqjs's Issues

Update globby to v10

Globby version <= 10 have a security vulnerability due to a downstream dependency. Please provide a new release depending on v10 or above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.