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

ever-html-to-object

v0.0.14

Published

将印象笔记导出的 html 转为一个 js 对象

Downloads

6

Readme

将印象笔记导出的 html 转为一个 js 对象

重要说明

  • 目前只支持印象笔记(国内版) 导出的 html

使用方法

// npm install ever-html-to-object
const ehto = require('ever-html-to-object')
const html = require('fs').readFileSync('我的笔记.html', 'utf-8')

ehto(html, { codeblock, plain, rmAssetsSuffix, rmAssetsPrefix }) // => 返回对象

选项说明

  • codeblock:Boolean:将笔记中代码块处理成 <pre><code>,默认为 true
  • plain:Boolean:将笔记正文的 html 转为纯文本,默认为 false
  • rmAssetsSuffix:Boolean:移除笔记正文中资源链接里的.resources(mac)/_files(win)后缀
  • rmAssetsPrefix:Boolean:直接移除资源文件夹地址,比如x_files/a.png => a.png
  • escapeMore:Boolean: 逃逸<!--more-->,暂不逃逸其他标签

对象属性

对象目前可能有的属性为:

  • title:String:笔记标题
  • body:String:笔记正文
  • created:String:笔记创建时间,格式YYYY-MM-DD HH:MM:SS
  • updated:String:笔记最近更新时间,格式同上
  • tags:[String]:标签列表
  • author:String:作者,一般是你的印象笔记用户名
  • source-url:String:来源,一般是剪藏的原地址

推荐用途

  • 通过 ejs/pug 等模板引擎渲染静态博客
  • 导出成 hexo/jekyll 可以读取的格式,通过 hexo 渲染静态博客