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 🙏

© 2026 – Pkg Stats / Ryan Hefner

cool-parser

v0.0.3

Published

A cool question parser

Readme

cool-parser

一款很酷的试题解析工具。

下载

通过js文件引用

下载地址:cool-parser.js

通过npm引用

npm i cool-parser
yarn add cool-parser

使用

import * as CoolParser from 'cool-parser'

const text = `中国第一个皇帝是?(B)
A、汉武帝
B、秦始皇
C、刘皇叔
D、汉高祖
`

const { errors, question } = CoolParser.parse(text)

js文件方式应用时,直接使用window.CoolParser即可。

参数

text

类型:String

题目的文字内容。

注:不要传入多个试题的文本内容,工具本身不处理多个题目的情况,请在外部进行题目划分后分别调用解析函数。

返回值

解析结果,数据结构如下:

属性 | 说明 | 类型 | 可选值 -- | -- | -- | -- errors | 错误列表 | Array | - question | 试题 | Question | -

题目格式

题干区

题干区可对题目的内容正确答案题型进行设置,如:

秦始皇是中国第一个皇帝吗?(对)[判断题]
中国第一个皇帝是(B)[单选题]

题干区需要注意这些情况:

  • 题干不允许换行,请在一行内描述试题
  • 填空题、简答题由于正确答案较长,不适宜在题干区设置,所以工具不解析出现在题干区的填空题与简答题答案

选项/答案区

题干区的下方(即从第2行开始)为选项/答案区,当题型为单选题、多选题、排序题、连线题时,该区域用于放置选项内容;当题型为填空题、判断题、简答题时,该区域用于放置答案,请见下方各种题型的展示情况。

单选题/多选题/排序题/连线题

A、选项一
B、选项二
C、选项三
D、选项四

填空题

李白&&李太白|苏轼&&苏东坡

简答题

普通关键词:北京|上海
核心关键词:GDP|科学发展观

设置区

选项/答案区的下方为设置区,设置区的风格为:

设置名:设置值

如:

分数:5分
难度:中
解析:秦始皇一统天下。

目前支持设置分数、难度与解析。

更多设计细节