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

hexo-tag-github-code

v0.1.0

Published

insert github code

Readme

hexo-tag-github-code

Insert code from GitHub when static files are generated.

Not embed.

Install

$ npm install hexo-tag-github-code --save

Usage

{% ghcode URL [start_line stop_line] [options] %}

Support URL

GitHub / Gist

  • URL of each file page as below
    • https://github.com/nkmk/hexo-tag-github-code/blob/master/index.js
    • https://gist.github.com/nkmk/d60cdbcffdb60d624ac01871543f79a2
    • https://gist.github.com/nkmk/d60cdbcffdb60d624ac01871543f79a2#file-sample-py
  • URL links to raw file as below
    • https://raw.githubusercontent.com/nkmk/hexo-tag-github-code/master/index.js
    • https://gist.githubusercontent.com/nkmk/d60cdbcffdb60d624ac01871543f79a2/raw/e7528c00addcdd0b4d00cb9bbd8d225cc132fbfc/sample.py

Other site

If URL links to raw file, it will work.

Options

Set like as {cap:false,re:true}. Please do NOT insert any spaces.

| option | description | default | | :--- | :--- | :--- | | cap| true: show caption false: no caption | true | | re| true: the first line number restart from 1 false: the first line number start from original code number | false |

Config setting

You can change default settings in _config.yml as below.

github_code:
  cap: false
  re: true

Examples

Full code

{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js %}

Selected lines

Insert code from line 17 to line 22.

{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js 17 22 %}

Selected lines

Without caption

{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js 17 22 {cap:false} %}

Without caption

Restart the first line number from 1

{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js 17 22 {re:true} %}

Restart the first line number from 1