Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hexo-nanoid

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-nanoid

Use ai/nanoid to generate abbreviated post links.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

hexo-nanoid

Use ai/nanoid to generate abbreviated post links.

Build Status npm npm license Gitmoji

Features

  • Compatible with hexo new to generate ID for new posts.
  • ID validatation on existing posts to ensure the uniqueness.
  • Ability to autofix invalid and conflicted post IDs.
  • Event nanoid:generate is emitted after each ID generation.

Configuration

The following list shows the descending precedence of config files. (The first one presented is used.)

  • Key nanoid in <hexo_root>/_config.yml
  • Key theme_config.nanoid in <hexo_root>/_config.yml
  • Key nanoid in <hexo_root>/themes/<theme_name>/_config.yml
  • Inline default config
interface HexoNanoIdOptions {
  /**
   * Autofix invalid or conflicted IDs.
   * @default false
   */
  autofix: boolean

  /**
   * Max try to find an unique ID.
   * @default 10
   */
  maxtry: number | "Infinity"

  /**
   * Ensure the ID uniqueness when creating a new post,
   * which somewhat slow down the new post generation
   * since all posts will be loaded and validated.
   * 
   * The uniqueness of the new post ID is not guaranteed if this config is set to `false`.
   * Check https://zelark.github.io/nano-id-cc/ for more info about collision probability.
   * @default true
   */
  check_on_new: boolean

  /***********************************/
  /*** Configuring nanoid library ***/
  /***********************************/

  /**
   * @default 21
   */
  length: number

  /**
   * @default "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-"
   */
  characters?: string
}

Keywords

FAQs

Package last updated on 25 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc