# qqjs

> useful functions for writing node scripts

Latest version **0.3.11** (published 2019-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install qqjs
pnpm add qqjs
yarn add qqjs
bun add qqjs
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.11 |
| Published | 2019-07-12 |
| First published | 2018-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 13 |
| Unpacked size | 23 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Jeff Dickey @jdxcode |
| Maintainers | dickeyxxx |
| Keywords | anycli |

## Links

- npm: https://www.npmjs.com/package/qqjs
- Repository: https://github.com/jdxcode/qqjs
- Issues: https://github.com/jdxcode/qqjs/issues
- npm.io page: https://npm.io/package/qqjs

## Dependencies (13)

- [tmp](https://npm.io/package/tmp.md) ^0.1.0
- [glob](https://npm.io/package/glob.md) ^7.1.2
- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [debug](https://npm.io/package/debug.md) ^4.1.1
- [execa](https://npm.io/package/execa.md) ^0.10.0
- [globby](https://npm.io/package/globby.md) ^10.0.1
- [tar-fs](https://npm.io/package/tar-fs.md) ^2.0.0
- [pkg-dir](https://npm.io/package/pkg-dir.md) ^4.2.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^6.0.1
- [http-call](https://npm.io/package/http-call.md) ^5.1.2
- [get-stream](https://npm.io/package/get-stream.md) ^5.1.0
- [load-json-file](https://npm.io/package/load-json-file.md) ^6.2.0
- [write-json-file](https://npm.io/package/write-json-file.md) ^4.1.1

## Recent versions

- 0.3.11 (latest) — 2019-07-12
- 0.3.10 — 2018-05-31
- 0.3.9 — 2018-05-10
- 0.3.8 — 2018-04-27
- 0.3.7 — 2018-04-23
- 0.3.6 — 2018-04-09
- 0.3.5 — 2018-04-09
- 0.3.4 — 2018-04-09
- 0.3.3 — 2018-04-08
- 0.3.2 — 2018-04-08
- 0.3.0 — 2018-04-08
- 0.2.1 — 2018-04-07
- 0.2.0 — 2018-04-07
- 0.1.0 — 2018-04-07
- 0.0.2 — 2018-02-07
- … 2 more at https://npm.io/package/qqjs/versions

## README

qqjs
====

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

[![Version](https://img.shields.io/npm/v/qqjs.svg)](https://npmjs.org/package/qqjs)
[![CircleCI](https://circleci.com/gh/jdxcode/qqjs/tree/master.svg?style=svg)](https://circleci.com/gh/jdxcode/qqjs/tree/master)
[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/jdxcode/qqjs?branch=master&svg=true)](https://ci.appveyor.com/project/heroku/qqjs/branch/master)
[![Codecov](https://codecov.io/gh/jdxcode/qqjs/branch/master/graph/badge.svg)](https://codecov.io/gh/jdxcode/qqjs)
[![Greenkeeper](https://badges.greenkeeper.io/jdxcode/qqjs.svg)](https://greenkeeper.io/)
[![Known Vulnerabilities](https://snyk.io/test/npm/qqjs/badge.svg)](https://snyk.io/test/npm/qqjs)
[![Downloads/week](https://img.shields.io/npm/dw/qqjs.svg)](https://npmjs.org/package/qqjs)
[![License](https://img.shields.io/npm/l/qqjs.svg)](https://github.com/jdxcode/qqjs/blob/master/package.json)

Usage
=====

It's best to [look at the code](src/index.ts) to see what all is available, but here is an example of using it:

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

---
_Source: https://npm.io/package/qqjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
