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

newpost

v1.1.2

Published

Make and manage your GitHub Pages/Jekyll blog post files.

Downloads

15

Readme

newpost: make GitHub Pages/Jekyll blog posts, faster.

Build Status npm version Prettier Badge Coverage Status

A little utility that creates a blog post file quickly, without copying and pasting front matter. Hate trying to remember what kind of front matter to put in your posts? Can't remember what ISO 8601 date format is to save your life? Install newpost and make managing your Jekyll/GitHub Pages blog posts easier than ever.

How does it work? 👀

Glad you asked! newpost adds in a custom config object to your package.json that contains front matter for your site. Running newpost init after installing lets you configure your front matter any way you like, and you configure it on a per project basis, so all your sites can have different blog post metadata.

newpost can also take front matter prop:value pairs straight from the command line! You can override properties from your config, as well as adding in any other property you want to have in your front matter for that post.

How to use newpost

Installation 🚀

npm:

npm install newpost

Yarn:

yarn add newpost

Set up front matter 💻 (Optional)

newpost init

Then start adding your metadata. Use this format <property>:<value> when adding front matter, and type q and hit enter when you're done!

Start blogging 🎉📝

You're all set up! If you set up a config object, you can run newpost myNewPostName to create a new blog entry with your default front matter. title is set to myNewPostName by default. The output looks like this:

---
title: myNewPostName
# everything else defined in your config object goes here...
---

To override that or any config-defined property, just pass it in as an arg:

newpost myNewPostName --title MyTitle --author Jahziel --coolProp awesome

This will create a new blog post file called <current ISO 8601 date>.myNewPostName.md, with the following contents:

---
title: myTitle
author: Jahziel
coolProp: awesome
# everything else defined in your config object goes here...
---

Make sure you pass in values with spaces in quotes!

newpost myNewPost --title "My really long blog post title" --author Jahziel --coolProp awesome

will give you:

---
title: My really long blog post title
author: Jahziel
coolProp: awesome
# everything else defined in your config object goes here...
---

--draft

Adding the --draft flag to any of the above commands will create a draft file instead of a post file. This means that the file will be created in the /_drafts directory instead of the /_posts directory. Additionally, the file will be called post_name.md instead of today-in-ISO8601-post_name.md. Files in the /drafts folder are ignored by Jekyll/GitHub Pages, so you can commit them, but they won't be public. Once you're done crafting the Next Great Blog Entry™️, use the undraft command to move your draft to the big leagues (/posts)!

Other commands 🖍

  • --help shows a help message with a quick breakdown of what newpost does!
  • --version shows the currently installed version
  • undraft post_name moves the post with filename post_name.md to the /_posts directory. If you don't have a /_posts, it creates it for you.
  • clean removes any config data that has been written to package.json

Dev stuff 👨‍💻👩‍💻

Getting started 🛫

Clone this repo! Then

yarn install

or

npm install

Testing 🧪

There are tests! You can run them! Just run

yarn test

or

npm test

You can open up /coverage/index.html to get a detailed coverage report.