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

@ernstwi/days

v2.0.1

Published

Journaling tool

Downloads

28

Readme

days

This is a tool for keeping a personal journal in the form of a directory of markdown files. There are two main commands: new for writing posts, and server to browse the journal as a webpage.

Journaling on iOS is supported via iMessage import (see days merge).

Status

⚠️ Note: Version 2.0.0 contains a security fix. Please do not use previous versions.

Please be mindful that this is a small project and that further security issues should be expected.

Directory structure

├── content
│   └── 2020 ....................... year
│       └── 04 ..................... month
│           └── 01 ................. day
│               ├── 12-00-00.md .... hh-mm-ss
│               └── allday.md ...... you can have one untimed post per day,
│                                    written for example when looking back at
│                                    some later point in time
├── assets ......................... files in this dir are served from root
│   └── image.jpeg ................. ![an image](/image.jpeg)
│
└── config.json .................... optional configuration file

Install

Install using npm or Homebrew.

$ npm install --global @ernstwi/days
$ brew install ernstwi/tap/days

Usage

All commands assume your current directory is the journal root.

new

Create a new post.

$ days new [--no-edit] [--allday] [<year> <month> <day> [<hour> [<minute> [<second>]]]]
  • If no date is given, the current time is used. With --allday, an all day post is created.
  • If a date is given, but no time, an all day post is created.
  • Without --no-edit, the post opens in $EDITOR.
  • With --no-edit, the filename is printed to stdout.

server

Start the web server.

$ days server [--port <number>] [--theme <name>]

merge

Import content from another journal, or from iMessage.

$ days merge [--resolve] (<path> | --imessage <ID>)
  • Merge posts from a days journal at <path>, or from an iMessage conversation with user <ID> (macOS only).
  • With --resolve, filename collisions on assets are resolved by renaming.

Tip: Set up a dummy Apple ID for the purpose of journaling.

prune

Clean up the content directory, removing empty subdirectories.

$ days prune

Configuration

The root directory may contain a file config.json with the following keys.

| Setting | Default value | | ------- | ------------- | | title | days | | port | 3004 | | theme | fruchtig |

Themes

| Name | Screenshot | Adapted from | | ---------- | -------------------------------------------------------------- | ----------------------------------------------------------------------- | | fruchtig | | schickele/vim-fruchtig | | nachtleben | | schickele/vim-nachtleben | | monochrome | | fxn/vim-monochrome |

Adding themes

You can create your own theme by adding a file static/theme/<theme-name>.css containing definitions for a subset of the following CSS variables.

| Name | Type | Fallback value | | ------------------------------- | ----- | -------------- | | --ui | color | gray | | --content | color | black | | --background | color | white | | --post-footer-fav | color | gold | | --link | color | blue | | --link-hover | color | magenta |

| Name | Type | Fallback value | | ------------------------------- | ----- | -------------- | | --blockquote-border | color | --content | | --day-header | color | --ui | | --day-header-background | color | --background | | --day-header-border | color | --ui | | --figure-border | color | --content | | --footer-diamond | color | --ui | | --link-disabled | color | --ui | | --no-posts | color | --ui | | --no-posts-border | color | --ui | | --post-body | color | --content | | --post-body-hr | color | --content | | --post-edit-bg | color | --background | | --post-edit-border | color | --ui | | --post-edit-fg | color | --content | | --post-edit-submit-background | color | --background | | --post-edit-submit-border | color | --ui | | --post-footer | color | --ui | | --post-footer-hr | color | --ui | | --sidebar-divider | color | --ui | | --sidebar-month | color | --ui | | --sidebar-year | color | --ui | | --start-index-border | color | --ui | | --start-index-border | color | --ui | | --start-year | color | --ui |

Testing

npm run test: Compile TypeScript and test the resulting JavaScript using Mocha.

To test iMessage merge functionality, you must define the environment variable DAYS_TEST_IMESSAGE. This value will be used as the recipient of a test message sent using Applescript on each run of the test suite. Note that this means automatically opening the Messages app and sending a message from your logged in user.

If DAYS_TEST_IMESSAGE is not defined, iMessage merge testing is skipped and no test message is sent.