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

chexo

v1.0.7

Published

Run 'hexo' from a module-based configuration.

Downloads

158

Readme

Chexo - Configure Hexo from an npm module!

To learn about the Tibetan rice dish, see https://goo.gl/vjeJq7. Yum!

This allows an npm module to provide a Hexo configuration, rather than needing to provide it from a static file. This allows a managed Hexo configuration to be updated and get updated automatically in a repository that depends on it.

While Hexo does support nested, inherited configurations by passing multiple configuration files with a --config flag, this automatically includes the configuration for each specified module, as well as the _config.yml which might be present at the root of the project (if it's present).

Usage

Essentially, pass the usual hexo arguments (e.g. generate, server, etc.), after the -- when calling chexo, which will pass them directly to hexo, with the exception of the --config argument. Any --config passed after -- will be appended to the end of the list we are already setting.

npx chexo npm-module-name another-npm-module -- generate

The config modules

The configuration modules should have a configuration YAML file and the default entry point for the module should return the absolute path to that module.

This means a configuration npm package needs two files:

_config.yml

A typical Hexo configuration file!

index.js (or the main attribute path in package.json)

// This should return the path to the _config so then we
// require("this-package"), it returns "/path/to/cfg/node_modules/_config.yml"
module.exports = require("path").resolve(__dirname, "_config.yml");

Arguments

Unflagged keywords will be interpreted as --from arguments.

  • --from: A module to configure from. Multiple --from flags may be passed.
  • --skip-root-config: Don't include the project's root _config.yml. This is the automatic behavior if the _config.yml doesn't exist in the root!