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

vuepress-new-page

v0.1.1

Published

A simple way to create a new VuePress page or post

Downloads

10

Readme

VuePress New Page

A simple way to create a new VuePress page or post

Build Status Coverage Status npm version Greenkeeper badge MIT License

Why

I'm lazy, get bored easily, and make a lot of mistakes.

What

It would create the directory and file with initial front matter such as title and current date.

Install

$ npm install --global vuepress-new-page

Usage

$ vuepress-new-page --help

  Usage: cli [options]

  vuepress-new-page version 0.1.0
  A simple way to create a new VuePress page or post

  Options:
    -v, --version                output the version number
    -t, --title <title>          Page/Post title - required
    -s, --slug [optional]        Page/Post slug
    -d, --date [optional]        Page/Post date
    -f, --dateformat [optional]  Page/Post dateformat - defaults to 'isoDateTime'
    -D, --directory [optional]   Page/Post directory - defaults to 'docs'
    -F, --filename [optional]    Page/Post filename - defaults to 'README.md'
    -h, --help                   output usage information


  Examples:
    $ vuepress-new-page --title="My Post Title"
    
    # or you can use the shorter alias `vp-new`
    $ vp-new --title="My Page Title" --directory="some/sub/dir"

Examples

Basic

$ vp-new --title="My Page Title"

Would create docs/my-page-title/README.md having the following content:

---

title: My Page Title

date: 2018-12-20T04:42:59+0200

---

# {{ $page.title }}

Custom options using command args

$ vp-new \
  --title="My Blog Post Title" \
  --directory="source/blog" \
  --filename="index.md" \
  --dateformat="yyyy-mm-dd HH:MM:ss"

Would create source/blog/my-blog-post-title/index.md having the following content:

---

title: My Blog Post Title

date: 2018-12-20 04:55:20

---

# {{ $page.title }}

Using rc file(s)

You can simply create an rc file .vuepress-new-pagerc and place it in your project directory.

Here's an example:

{
  "directory": "projects/node/cli",
  "filename": "index.md",
  "dateformat": "default",
  //
  // here's how you can set your own template as an array
  // the array is simply joined with "\n"
  //
  "template": [
    "---",
    "",
    "title: %%title%%",
    "",
    "date: %%date%%",
    "",
    "author: [Webmasterish](https://webmasterish.com)",
    "",
    "description: A simple way to create a new VuePress page or post",
    "",
    "meta:",
    "  - name: twitter:title",
    "    content: %%title%%",
    "  - name: twitter:description",
    "    content: A simple way to create a new VuePress page or post",
    "  - name: twitter:url",
    "    content: {{ $site.url }}{{ $page.permalink }}",
    "  - property: og:type",
    "    content: article",
    "  - property: og:title",
    "    content: %%title%%",
    "  - property: og:description",
    "    content: A simple way to create a new VuePress page or post",
    "  - property: og:url",
    "    content: {{ $site.url }}{{ $page.permalink }}",
    "",
    "---",
    "",
    "# %%title%%",
    "",
    "> on %%date%% i created %%title%%",
    ""
  ]
  //
  // and here's an example having the template set as a string
  //"template": "---\ntitle: %%title%%\n---"
  //
}

Assuming you have the same rc file as the above, and have placed at ./.vuepress-new-pagerc, and then used vp-new -t "VuePress New Page - Node Cli App ✨", the result would be a file created at ./projects/node/cli/vuepress-new-page-node-cli-app/index.md having the following content:

---

title: VuePress New Page - Node Cli App ✨

date: Thu Dec 20 2018 06:05:14

author: [Webmasterish](https://webmasterish.com)

description: A simple way to create a new VuePress page or post

meta:
  - name: twitter:title
    content: VuePress New Page - Node Cli App ✨
  - name: twitter:description
    content: A simple way to create a new VuePress page or post
  - name: twitter:url
    content: {{ $site.url }}{{ $page.permalink }}
  - property: og:type
    content: article
  - property: og:title
    content: VuePress New Page - Node Cli App ✨
  - property: og:description
    content: A simple way to create a new VuePress page or post
  - property: og:url
    content: {{ $site.url }}{{ $page.permalink }}

---

# VuePress New Page - Node Cli App ✨

> on Thu Dec 20 2018 06:05:14 i created VuePress New Page - Node Cli App ✨

Reference

License

MIT © webmasterish