npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

notion-to-text

v0.1.5

Published

A tool to get content of publicly shared notion .site pages

Downloads

6

Readme

notion-to-text

CLI program which outputs to stdout. It also supports running as server.

Install

using npm

npm i -g notion-to-text

or from sources

git clone https://github.com/pirafrank/notion-to-text
cd notion-to-text/standalone
npm link

Usage

ntt <command> [<args>]

Commands:
  ntt get <URL>  Get content from URL and print to stdout           [aliases: g]
  ntt serve      start the server                                   [aliases: s]

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

Examples:
  ntt get <URL>                     get content from notion.site URL
  ntt serve                         start the server on 0.0.0.0:3000
  ntt serve --port 3001             start the server on port 3001
  ntt serve --host "192.168.0.123"  start the server and bind to given host

You need to provide one command at least.
ntt get <URL>

Get content from URL and print to stdout

Options:
      --version  Show version number                                   [boolean]
      --help     Show help                                             [boolean]
  -j, --json     print output in JSON format                           [boolean]
ntt serve

start the server

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]
  --port     port the server listens on                 [number] [default: 3000]
  --host     address the server binds to           [string] [default: "0.0.0.0"]

APIs

Just call server APIs by adding your hostname at the beginning + the response type you want to get.

These are available:

  • text or raw for a text/plain response,

  • json for an application/json one.

For example:

Notion page URL|Method|Endpoint|Response type ---|---|---|--- https://pirafrank.notion.site|GET|http://localhost:3000/json/pirafrank.notion.site|application/json https://pirafrank.notion.site/My-toolbelt-c3e17a2462d64b549e3ec7009e6f3071|GET|http://localhost:3000/text/pirafrank.notion.site/My-toolbelt-c3e17a2462d64b549e3ec7009e6f3071|text/plain

In case of error, you'll always get an application/json response.

package.json scripts

Command-line

# npm run cli [a *.notion.site url]
# e.g.
npm run cli "https://pirafrank.notion.site"

Server

Start the server

npm run server

Development

.vscode folder in the repository root holds config to run/debug each module (core, standalone and lambda).

Why

Notion is a great note-taking tool and with sites an easy way to maintain a public page. Unfortunately being a PWA you can't get page content just by using curl, so that's where notion-to-text can help.

I've created it for personal use and as such it is provided as-is with no warranties.

License

MIT