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 🙏

© 2025 – Pkg Stats / Ryan Hefner

md-to-js

v1.1.14

Published

markdown文档转换为js代码

Downloads

1

Readme

使用markdown 生成js代码

shell用法:

公司内部专用

下载:

npm install md-to-js
cd md-to-js
npm link

使用bin下脚本自动生成

  • 生成的内容放在服务运行目录下的output目录下
  • 生成output目录结构
├── output
│   ├── js_file                     #生成js文件位置
│   │   ├── demo.js
│   │   └── mock                    #生成mock数据位置
│   │       ├── api1.js
│   │       ├── api2.js
│   │       └── orderSearch.js
│   └── md_file                     #存放markdown文件位置
│       └── demo.md

生成md规范示例文件 demo.md

 createMd  
  • 该文件生成于./output/md_file/文件夹下

生成mock数据以及js代码

md2js
  • 请将要生成的API markdown文件存放于 ./output/md_file/目录下
  • API 对应生成的js文件与 mock 文件分别位于 ./output/下的对应文件夹内

js用法

生成md规范示例文件

let mj = require('md-to-js');
mj.createMd('./demo.md');
  • 在当前目录下生成demo.md markdown文件

md直接生成js文件

let mj = require('md-to-js');
mj.all(mdfile, jsfile);
  • mdfile 为存放API的文件或文件夹
  • jsfile 选填参数,存放生成的js文件存放的位置,必须为文件夹, 默认存放于 ./output/js_file/ 目录下