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

tanager

v0.1.0

Published

Start writing quickly. Helps you maintain notes and journals as standalone, organized files.

Downloads

3

Readme

Manage your notebooks. Start writing quickly.

Build Status

tanager: Hassle Free Writing

tanager is a notebook manager. It helps you organize files for writing. Use it to organize your journals and notes. It does not impose any structure on these files, but it is opinionated about where the files are stored and how they are named. If you don't like those opinions, you can customize it to do what you want.

If you like to maintain notes in flat files and spend a lot of time navigating to the correct directories or abiding by your own naming conventions, tanager could be for you.

Overview

tanager does absolutely nothing fancy. It could just as easily be a shell script or system of shell aliases. For example, imagine this workflow. I have a meeting today with Joe. It is for work, and I like to keep my work notes in ~/Dropbox/notes. Before each meeting I type vim ~/Dropbox/notes/2017/2017-03-07_joe-meeting.md. Then I take notes. This is completely reasonable, but it's a lot of work to get up and running. Instead, I can type tanager notes joe meeting and it will accomplish the exact same thing.

I organize my journal the same way as I do my notes. I write more journal entries than notes, so my default notebook is journal. Since it is the default, tanager journal day one in peru and tanager day one in peru do the same thing. (Note that if you had a notebook called day, it might not do what you wanted, instead adding an entry to the notebook called day.) If I'm just making a quick note and I don't want to give the file name a title, the default title will be daily.

Installation

Keep in mind that however you install it, you'll have to set up a config file before it will work. Eventually I might add a smart setup option, but for now you have to do this by hand. See the Configuration section below.

You can run tanager from your local repo by cloning and typing npm install -g from the local directory. Alternatively, you can use npm:

npm install -g tanager

To run tests:

npm test

Usage

Overview

tanager helps you start writing quickly. See the understanding tanager section to see where it puts your files. To start writing notes in your notes notebook:

tanager notes meeting with vip

If the day is March 9, 2017, this will by default open your editor with a file called: 2017-03-09_meeting-with-vip.md. You can then begin editing.

If you also have a notebook called journal, you can instead type:

tanager journal day one in peru

By default this will open a file named 2017-03-09_day-one-in-peru.md, but will be in your journal notebook (i.e. saved in a different directory).

By default these files will be in your notebook saved in a directory for the year--2017 in the examples above. See the Configuration section for more information on customizing the paths.

Specifying a Date Other Than Today

You can also specify a different date using the -d flag. This does its best to do natural language parsing as provided by the chrono library. To start a journal entry for yesterday, you can say:

tanager -d yesterday leaving for lichtenstein

This will interpret yesterday to be the date, so instead it will open your editor to 2017-03-08_leaving-for-lichtenstein.md.

Editing Last Modified File

The -r/--recent and -l/--last flags will begin editing the most recently modified file in a given notebook, allowing you to repeatedly update an entry over the course of a day or jump back in after a restart.

Full Output of tanager --help

  Usage: tanager [options] <words...>

  Options:

    -h, --help                       output usage information
    -V, --version                    output the version number
    -c, --config-file <config-file>  Path to config file. Defaults to
                                       ~/.tanager.json
    -d, --date <date>                Date of the entry. Yesterday, dec5,
                                       "dec 5", etc
    -e, --editor-cmd <editor-cmd>    Editor used to edit. Defaults to
                                       config.editor, $VISUAL, then $EDITOR
    -r, --recent                     Edit the most recently modified file in
                                       a notebook (same as --last)
    -l, --last                       Edit the last modified file in a notebook
                                       (same as --recent)
    --pwd                            Print the path to the notebook

Understanding tanager

tanager separates writing into different files for each day. A basic directory structure for a journal might look like:

journal/
  2016/
    2016-03-05_day-in-london.md
    2016-03-06_daily.md
  2017/
    2017-01-01_new-year-party.md
    2017-01-01_daily.md

Some things to notice:

  • Files are organized by year.
  • Files are prefixed by date.
  • Files are saved as markdown.
  • Files can be given a title. If no title is given, it is given the default title daily.
  • Document trees, or 'notebooks' can be rooted at different locations. In this case it is rooted at journal/, but you can have multiple notebooks on the same system. In this way tanager journal would open an entry for your personal journal, but tanager notes would open an entry for your notes files.

Configuration

Config information lives in ~/.tanager.json. It should have at a minimum a notebooks object, where each property is a notebook name and points to an object that includes a path property. default: true indicates that this is the notebook that should be used if no name is specified.

For now the quickest way to understand it is with an example:

{
  "notebooks": {
    "journal": {
      "path": "~/Dropbox/journal/",
      "template": "<YYYY>/<YYYY-MM-DD>_<title>.md",
      "defaultTitle": "daily",
      "aliases": ["j", "jl"],
      "default": true
    },
    "notes": {
      "path": "~/Documents/notes"
    }
  }
}

Note the template and defaultTitle keys.

The template key allows you to organize your files within a notebook. The strings in angled brackets (except for the special case <title>) are passed to the moment.js format function. In the example above, the template says that for March 19, 2018, invoking tanager would open the file:

~/Dropbox/journal/2018/2018-03-19_daily.md

If you do not specify a title, the property defaultTitle is used. If you do not specify defaultTitle, the default daily is used. If you do not specify a template, the default template is <YYYY>/<YYYY-MM-DD>_<title>.md.

If you want your files saved by year and month, you could set template to be:

<YYYY>/<MM>/<YYYY-MM-DD>_<title>.md

If a template is specified, it must include <title>.

Shout-outs

tanager is inspired by tools like jrnl but does not try to replace them. They do different things. If you set your jrnl file to reside in the root directory of a tanager notebook, you could even get the best of both worlds--keeping jrnl for your short entries, if you like that kind of thing, but using tanager to manage longer entries.

If tanager doesn't meet your needs, here is a list of other tools that do similar things: