Skip to content

docs(api): fix tmpfile() example to show matching output filename#1474

Open
piy-ushk wants to merge 1 commit into
google:mainfrom
piy-ushk:piyush
Open

docs(api): fix tmpfile() example to show matching output filename#1474
piy-ushk wants to merge 1 commit into
google:mainfrom
piy-ushk:piyush

Conversation

@piy-ushk

Copy link
Copy Markdown

Fixes #1469

Corrects the inline comment in docs/api.md under the tmpfile() section.

The example showed tmpfile('f2.txt') resulting in a path ending in foo.txt, which doesn't match the passed argument. Under the hood, tempfile(name) returns path.join(tempdir(), name), so the returned path should end in f2.txt. This PR fixes the comment to accurately reflect the implementation.

import { tmpfile } from 'zx'

const f2 = tmpfile('f2.txt')  // -> /os/based/tmp/zx-1ra1iofojgg/f2.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(api): tmpfile('f2.txt') example shows wrong output filename (foo.txt)

1 participant