Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Support Stream.Writable as to_file #1624

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

ggrossetie
Copy link
Member

It can be useful when you want both the Asciidoctor.Document and the result in a single call:

const data = []
const writableStream = new Writable({
  write (chunk, encoding, callback) {
    data.push(chunk.toString())
    callback()
  }
})
const doc = asciidoctor.convert(text, { to_file: writableStream, safe: safe })
const html = data.join('')

@ggrossetie ggrossetie merged commit 99ba4c5 into asciidoctor:main Mar 16, 2022
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.

None yet

1 participant