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

gimonfu

v0.3.2

Published

CLI tool to manage articles of Hatena-blog.

Downloads

2,341

Readme

English / Japanese

gimonfu

logo

gimonfu is a CLI tool to manage articles of Hatena-blog.

gimonfu upload(download) markdown files to(from) Hatena-blog.

Setup

# Set the edit mode to Markdown. (Hatena-Blog > Settings > Basic Settings)

$ yarn global add gimonfu
# or $ npm install --global gimonfu

$ mkdir blog
$ cd blog
$ gimonfu init

Usage

Register Credentials

To register credentials to .gimonfu.json, you can run like this:

$ gimonfu init

Please execute this command before executing $ gimonfu pull or $ gimonfu push.

Credentials are registered by creating a .gimonfu.json file in the current directory. You can also create .gimonfu.json manually without executing this command.

Download Articles

To download new or updated articles to entry/ directory, you can run like this:

$ gimonfu pull

Upload Articles

To upload new or updated articles in entry/ directory, you can run like this:

$ gimonfu push

The relative path from the entry/ directory is set as a custom URL with uploading.

Judging posts/updates

Post a new file that corresponds to the following.

  • YAML-Frontmatter doesn't have an article ID.

Update the following files from an already published article.

  • YAML-Frontmatter has the article ID.
  • There are any changes.
  • The last update date is newer than the one already published.

Overwriting a file

When a new post/update is made, the contents of the file will also be overwritten to match the content of the post.

For example, an ID is written into the YAML-Frontmatter when new posts are made, or they are deleted, if there are unnecessary fields in the YAML-Frontmatter before new posts/updates are made.

Directory Structure

.
├── .gimonfu.json
└── entry
     ├── hello.md
     ├── 2020
     │   └── 05
     │        └── 09
     │             └── 10101010.md
     └── ...

.gimonfu.json

The format is like this:

{
  "user_id" :  "basd4g",
  "api_key" : "h0o1g2e3f4u5ga",
  "blog_id" : "basd4g.hatenablog.com"
}

This API key is fake.

Please register your user id, API key, and blog id.

entry/

All articles are stored in the directory.

The structure in the directory is the same as the end of the published article URL (expect for .md at the end of the file).

This is accomplished by setting a custom URL for every post when it is posted/updated.

Article File

Each article is saved in markdown format under entry/.

The format is like this:

---
title: Hello!
date: 2019-09-16T16:37:00.000Z
categories:
  - essay
  - happy day
id: "26006613568876375"
draft: true
---
The body of the article continues below...

The ID of the article is not needed for a new post. It is automatically appended when you post. And please do not make any changes.

The line of draft: true is option. If it is not exist, it is expected public.

Caution

USE GIT

A pull or push may create/overwrite/delete local files and published articles. It is highly recommended that you manage your article files in a version control system such as git in case of inadvertent deletion of the article.

If you use git, you must not include .gimonfu.json in the repository, which contains credentials.

GitHub Actions

You can sync Hatena-blog and GitHub to use gimonfu on GitHub Actions.

My blog is an example. (Hatena-blog / GitHub Repository)

License

MIT

Author

basd4g