2.0.0 • Published 4 years ago

@progfay/scrapbox-parser-stream v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Scrapbox Parser Stream

Parsing Scrapbox notation with Node.js Stream

Installation

$ npm i @progfay/scrapbox-parser-stream

Usage

import ScrapboxParserStream from '@progfay/scrapbox-parser-stream'
import fetch from 'node-fetch'

const PROJECT_NAME = 'help'
const PAGE_NAME = 'syntax'

fetch(`https://scrapbox.io/api/pages/${PROJECT_NAME}/${PAGE_NAME}/text`)
	.then(({ body }) => {
		body
			.pipe(new ScrapboxParserStream({ hasTitle: true }))
			.pipe(process.stdout)
	})