Skip to content

Commit

Permalink
Add path package
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Aug 27, 2021
1 parent 33aaae4 commit ce69a84
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ The [os](https://nodejs.org/api/os.html) package.
await $`cd ${os.homedir()} && mkdir example`
```

#### `path` package

The [path](https://nodejs.org/api/path.html) package.

```js
await $`mkdir ${path.join(basedir, 'output')}`
```

#### `minimist` package

The [minimist](https://www.npmjs.com/package/minimist) package.
Expand Down
4 changes: 3 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {Readable, Writable} from 'stream'
import * as _fs from 'fs-extra'
import * as _globby from 'globby'
import * as _os from 'os'
import * as _path from 'path'
import * as _chalk from 'chalk'
import _fetch from 'node-fetch'
import {ParsedArgs} from 'minimist'
Expand Down Expand Up @@ -62,9 +63,10 @@ export const cd: cd
export const chalk: typeof _chalk
export const fetch: typeof _fetch
export const fs: typeof _fs
export const globby: typeof _globby.globby & typeof _globby
export const glob: typeof _globby.globby & typeof _globby
export const globby: typeof _globby.globby & typeof _globby
export const nothrow: nothrow
export const os: typeof _os
export const path: typeof _path
export const question: question
export const sleep: sleep
3 changes: 2 additions & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import fs from 'fs-extra'
import * as globbyModule from 'globby'
import os from 'os'
import path from 'path'
import {promisify, inspect} from 'util'
import {spawn} from 'child_process'
import {createInterface} from 'readline'
Expand All @@ -23,7 +24,7 @@ import which from 'which'
import chalk from 'chalk'
import minimist from 'minimist'

export {chalk, fs}
export {chalk, fs, os, path}
export const sleep = promisify(setTimeout)
export const argv = minimist(process.argv.slice(2))
export const globby = Object.assign(function globby(...args) {
Expand Down
1 change: 0 additions & 1 deletion test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

import {strict as assert, deepEqual} from 'assert'
import path from 'path'

{ // Only stdout is used during command substitution
let hello = await $`echo Error >&2; echo Hello`
Expand Down

0 comments on commit ce69a84

Please sign in to comment.