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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nuxtpress

v0.3.0

Published

NuxtPress is a professional blog module for nuxt.js

Downloads

40

Readme

NuxtPress

github npm npm npm codebeat code-size

是时候表演一波真正的技术了。代码行数: 仅 255 行。

示例

地址: https://v0.chat 源码: https://github.com/assholev0/v0.chat

配置

创建 .nuxtpress.config.js (根目录下,与nuxt.config.js同级)。

module.exports = {
  source: '_source', // 默认文章目录
  per_page: 10, // 默认分页 10/页, 0 为关闭分页
};

API

$np 方法

np 是 NuxtPress 的缩写。在 Nuxt 页面中,可以这样使用:

export default {
  async asyncData({app}) {
    return {
      posts: await app.$np.posts(1)
    }
  }
}

info 基本信息

app.$np.info()

返回:

{
title: "初瘦",
description: "想当初,也瘦过。公众号:assholev0",
posts: 3,
tags: 4,
categories: 2,
wordcount: 2451
}

posts 文章列表

app.$np.posts(page)

参数:

  • page: 页码 (默认为1)

返回:

{
  "page": 1,
  "pages": 1,
  "posts": [
    {
      "excrept": "<h2>此处是摘要</h2>",
      "wordcount": 1191,
      "tags": [
        "生活"
      ],
      "category": [
        "闲聊"
      ],
      "title": "初瘦与那些他的三观不正的杂念",
      "date": "2018-09-19T07:19:29.000Z",
      "slug": "assholev0"
    }
    // 。。。
  ]
}

post 文章

app.$np.post(slug)

参数:

  • slug: 文章别名,必须

返回:

{
  "post": {
    "content": "<h2 id=\"何谓初瘦?\"><a class=\"header-anchor\" href=\"#何谓初瘦?\" aria-hidden=\"true\">#</a> 何谓初瘦?</h2>。。。。。。",
    "excrept": "<h2>此处是摘要</h2>",
    "wordcount": 1191,
    "tags": [
      "生活"
    ],
    "category": [
      "闲聊"
    ],
    "title": "初瘦与那些他的三观不正的杂念",
    "date": "2018-09-19T07:19:29.000Z",
    "slug": "assholev0"
  }
}

tags 标签

app.$np.tags(search)

参数:

  • search: 传入标签名称,查询标签下的日志 (默认为空)

返回:

{
  "tags": [
    {
      "name": "vue",
      "count": 1
    },
    {
      "name": "vuepress",
      "count": 1
    },
    {
      "name": "前端",
      "count": 1
    },
    {
      "name": "生活",
      "count": 2
    }
  ],
  "posts": [
    {
      "excrept": "<h2>此处是摘要</h2>",
      "wordcount": 1191,
      "tags": [
        "生活"
      ],
      "category": [
        "闲聊"
      ],
      "title": "初瘦与那些他的三观不正的杂念",
      "date": "2018-09-19T07:19:29.000Z",
      "slug": "assholev0"
    }
  ]
}

categories 分类

app.$np.categories(search)

参数:

  • search: 传入分类名称,查询分类下的日志 (默认为空)

返回:

{
  "categories": [
    {
      "name": "技术",
      "count": 1
    },
    {
      "name": "闲聊",
      "count": 2
    }
  ],
  "posts": [
    {
      "excrept": "<h2>此处是摘要</h2>",
      "wordcount": 1191,
      "tags": [
        "生活"
      ],
      "category": [
        "闲聊"
      ],
      "title": "初瘦与那些他的三观不正的杂念",
      "date": "2018-09-19T07:19:29.000Z",
      "slug": "assholev0"
    }
  ]
}

archives 归档

app.$np.archives()

返回:

{
  "posts": [
    {
      "wordcount": 1191,
      "tags": [
        "生活"
      ],
      "category": [
        "闲聊"
      ],
      "title": "初瘦与那些他的三观不正的杂念",
      "date": "2018-09-19T07:19:29.000Z",
      "slug": "assholev0"
    },
    // 。。。
  ]
}

TODO List

  • [ ] add Page Render
  • [x] add API Server Middleware
  • [x] add Request Plugin
  • [x] add Build Hook

License

MIT