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

workflowy

v2.1.0

Published

WorkFlowy client for reading and updating of lists

Downloads

137

Readme

WorkFlowy API

This is a WorkFlowy client for Deno and Node. The goal of this library is to enable WorkFlowy power users to access WorkFlowy lists programatically and perhaps create some new automations and integrations.

Features

  • Reading and updating WorkFlowy lists
  • Export of lists to JSON or formatted plain text
  • Basic search of items in lists
  • Support for live copies (mirrors)

Basic usage

Authentication

In order to access WorkFlowy content, you need to provide your WorkFlowy username and password. Authentication via one-time code or two-factor authentication are not supported because of technical limitations of WorkFlowy API.

Fetching a WorkFlowy document

import { WorkFlowy } from "workflowy";

// Log in with your username and password
const workflowy = new WorkFlowy("[email protected]", "your-password");
// Load WorkFlowy outline into an interactive document structure
const document = await workflowy.getDocument();

Finding lists in a document

const rootList = document.root;
const topLevelLists = document.items; // array of lists in the root
const myList = topLevelLists[0];

myList.findOne(/^Needle/); // Finds a sublist using a RegExp
myList.findAll(/^Needle/); // Finds all sublists using a RegExp

Accessing basic list properties

const rootList = document.root;
const myList = document.items[0];

myList.name; // name of the list
myList.note; // note of the list
myList.isCompleted; // whether or not the list or item is completed
myList.items; // items and sublists

Editing lists

myList.setName("New name").setNote("New note"); // sets a name and a note
const sublist = myList.createList(); // Creates a sublist
const subitem = myList.createItem(); // Alias for createList

myList.move(targetList); // moves a list or item to a different list
myList.delete(); // deletes the list

Saving the changes to WorkFlowy

if (document.isDirty()) {
  // Saves the changes if there are any
  await document.save();
}

Installation

From npm (Node/Bun)

npm install workflowy    # npm
yarn add workflowy       # yarn
bun add workflowy        # bun
pnpm add workflowy       # pnpm

From deno.land/x (Deno)

Unlike Node, Deno relies on direct URL imports instead of a package manager like NPM. The latest Deno version can be imported like so:

import { WorkFlowy } from "https://deno.land/x/workflowy/mod.ts";

Acknowledgements

Big thanks to Mike Robertson for providing the workflowy NPM package name!

License

MIT