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

@wangjiezhe/hexo-symbols-count-time

v0.7.2

Published

Symbols count and time to read for articles.

Downloads

70

Readme

hexo-symbols-count-time

npm-image node-image hexo-image cover-image travis-image appveyor-image lic-image

Symbols count and time to read for articles in Hexo blog.

Better than hexo-reading-time and faster than hexo-wordcount. No external dependencies.

Installation

size-image dm-image dt-image

$ npm install hexo-symbols-count-time

Usage

You can set options of hexo-symbols-count-time in the Hexo's _config.yml (which locates in the root dir of your blog):

symbols_count_time:
  symbols: true
  time: true
  total_symbols: true
  total_time: true
  exclude_codeblock: false
  awl: 4
  wpm: 275
  suffix: "mins."

If symbols_count_time option is not specified, the default parameters will be used.

Parameters

  • awl – Average Word Length (chars count in word). Default: 4. You can check this here.
    • CN ≈ 2
    • EN ≈ 5
    • RU ≈ 6
  • wpm – Words Per Minute. Default: 275. You can check this here.
    • Slow ≈ 200
    • Normal ≈ 275
    • Fast ≈ 350
  • suffix – If time to read less then 60 minutes, added suffix as string parameter.
    If not defined, mins. will be used as default.
  • exclude_codeblock – Allow to exclude all content inside code blocks for more accurate words counting.
    If not defined, false will be used as default.

Note for Chinese users: because in Chinese language average word length about ~1.5 and if you at most cases write posts in Chinese (without mixed English), recommended to set awl to 2 and wpm to 300.
But if you usualy mix your posts with English, awl to 4 and wpm to 275 will be nice.

NexT theme

This plugin integrated in «NexT» and after plugin enabled in main Hexo config, you may adjust options in NexT config:

symbols_count_time:
  separated_meta: true
  item_text_post: true
  item_text_total: false

Development

$ cd hexo
$ git clone https://github.com/theme-next/hexo-symbols-count-time.git node_modules/hexo-symbols-count-time
$ cd node_modules/hexo-symbols-count-time

Tests

$ npm install mocha chai --save-dev
$ npm test

Tests with coverage

$ npm install -g nyc
$ nyc --print both node_modules/.bin/_mocha -- test/index.js

Templates

Symbols Count

{{ symbolsCount(post) }}

Symbols Time

{{ symbolsTime(post) }}

Or with predefined parameters:

{{ symbolsTime(post, awl, wpm, suffix) }}

Symbols Count Total

{{ symbolsCountTotal(site) }}

Symbols Time Total

{{ symbolsTimeTotal(site) }}

Or with predefined parameters:

{{ symbolsTimeTotal(site, awl, wpm, suffix) }}

Renderers syntax

SWIG / Nunjucks: {{ template }}
EJS: <%- template %>
Jade: span= template