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

ncu-libary

v2.2.8

Published

NCU libary Helper

Downloads

15

Readme

介绍

用于查询图书是否能借阅。一次性查询多本图书,省时省力。 同时设置并发数为5,防止被封禁。

运行方式

npm install ncu-libary --save

将要查找的图书地址,放入一个json文件中即可。

格式如下:

用数组方式,放置网址。或者传入数组

[
  "http://210.35.251.243/opac/item.php?marc_no=0000833661",
  "http://210.35.251.243/opac/item.php?marc_no=0000840261"
]

使用:

var lib = require('ncu-libary')
// 函数内填数组,如:
var list = [
  "http://210.35.251.243/opac/item.php?marc_no=0000833661",
  "http://210.35.251.243/opac/item.php?marc_no=0000840261"
]
lib.booksInfo(list)
  .then(data => {
    // 对获取到的图书数据进行操作
  })
  .catch(err => {
    // 错误处理
  })

// 查询用户借阅书籍
lib.lend(username, password = '123456')
.then(data => console.log(data))

// 查询书籍,默认只能查询前湖校区的图书
lib.search(bookname, page = 1)
.then(data => {
  console.log(data)
})

返回的格式:

[{ 
  // 图书标题
  title: '《图解CSS3核心技术与案例实战》',
  // 图书在流通书库的位置
  location: 'TP393.092.2/143 ',
  // 图书的可借阅数量
  canBorrowNum: 0 
}]

开发

git clone https://github.com/Lxxyx/ncu-libary
cd ncu-libary
npm install
gulp

测试

全局安装mocha

npm i mocha -g

然后:

npm test