roam-export
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

roam-export

Export filtering and processing library for https://roam.garden/

Installation

npm i roam-export

Usage

A basic usage is as follows:

import { RoamBlock, RoamJsonQuery, RoamPage } from "roam-export"
import { readFileSync } from "fs"

const data = readFileSync("path to json export", "utf8")
const allPages = JSON.parse(data) as Array<RoamPage>
  
const { pages, blockUids } = new RoamJsonQuery(allPages, 
  {makePagesWithTheseTagsPublic: ["make-public"], makeBlocksWithTheseTagsPrivate: []}).getPagesToRender()
  
// do something with pages

There are more tools for operating on Roam JSON available internally (see https://github.com/roam-garden/roam-export/blob/master/src/roam-utils.ts and https://github.com/roam-garden/roam-export/blob/master/src/filtering.ts)

Package Sidebar

Install

npm i roam-export

Weekly Downloads

4

Version

0.1.3

License

Apache-2.0

Unpacked Size

45.9 kB

Total Files

26

Last publish

Collaborators

  • stvad