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

nbinet-collection-crawler

v1.2.2

Published

Unofficial National Bibliographic Information Network collection crawler

Downloads

13

Readme

Unofficial National Bibliographic Information Network Collection Crawler

NPM version Actions status Codecov status Code style License MIT

全國圖書書目資訊網館藏資料爬蟲

Installation

  • NPM
npm install nbinet-collection-crawler --save
  • Yarn
yarn add nbinet-collection-crawler

Usage

const nbinetCollectionCrawler = require('nbinet-collection-crawler');

const run = async () => {
  const results = await nbinetCollectionCrawler('護理學博士教育課程規劃與評值研討會', 'keyword');
  console.log(results);
};

run();

Demo

Commands

# To download the files and install packages.
$ git clone https://github.com/FlowerEatsFish/nbinet-collection-crawler.git
$ cd nbinet-collection-crawler
$ yarn install # npm install

# To run a demo.
$ yarn start # npm start

Results

>>> You search data using keyword "護理學博士教育課程規劃與評值研討會" and type "keyword".

{
  bookDetail: [
    { bookKey: '題名', bookValue: '護理學博士教育課程規劃與評值研討會 = The Curriculum Design and Evaluation of Doctoral Program in Nursing / 臺北醫學大學護理學院主辦; 臺灣護理教育學會等協辦' },
    { bookKey: '出版項', bookValue: '2008' },
    { bookKey: '出版項', bookValue: '[臺北市 : 臺北醫學大學護理學院, 民97.04]' },
    { bookKey: '面數高廣', bookValue: '123面 : 圖 ; 30公分' },
    { bookKey: '國際標準書號', bookValue: '平裝' },
    { bookKey: '附註', bookValue: '主要內容為英文' },
    { bookKey: '附註', bookValue: '含參考書目' },
    { bookKey: '標題', bookValue: '護理學' },
    { bookKey: '標題', bookValue: '高等教育' },
    { bookKey: '標題', bookValue: '課程規劃設計' },
    { bookKey: '標題', bookValue: '會議' },
    { bookKey: '其他著者', bookValue: '臺北醫學大學 護理學院' },
    { bookKey: '其他著者', bookValue: '臺灣護理教育學會' },
    { bookKey: '其他著者', bookValue: '護理學博士教育課程規劃與評值研討會 (民97 臺北醫學大學)' },
    { bookKey: '其他題名', bookValue: 'The Curriculum Design and Evaluation of Doctoral Program in Nursing' },
    { bookKey: '其他題名', bookValue: '護理學博士教育課程規劃與評值研討會會議手冊' }
  ],
  collection: [
    {
      library: '國家圖書館',
      callNumber: '419.63 8646 97 ',
      status: '依各館館藏為準'
    }
  ],
  url: 'http://nbinet3.ncl.edu.tw/search~S1*cht/?searchtype=X&searcharg=%E8%AD%B7%E7%90%86%E5%AD%B8%E5%8D%9A%E5%A3%AB%E6%95%99%E8%82%B2%E8%AA%B2%E7%A8%8B%E8%A6%8F%E5%8A%83%E8%88%87%E8%A9%95%E5%80%BC%E7%A0%94%E8%A8%8E%E6%9C%83&searchscope=1'
}
>>> You search data using keyword "9789867494122" and type "isbn".

[
  {
    bookDetail: [ {...}, {...}, ... ],
    collection: [ {...}, {...}, ... ]
  },
  { ... }, { ... }, ...
] # Array.prototype.length <= 50
>>> You search data using keyword "blablablablablablablablablablablabla" and type "keyowrd".

null

Documentation

Input parameters

import nbinetCollectionCrawler from 'nbinet-collection-crawler';

const result = nbinetCollectionCrawler(
  keyword,  // string. Necessary.
            // If you set it as null, it will get an error.
  dataType, // string. Default: "keyword". Optional: "keyword", "isbn".
            // Every page only shows maximum 50 results.
            // If you enter out of optional values, it will set "keyword".
);

Output results

// If you get one result, it will return an "object".
result = {
  bookDetail: object[] | null
  [
    {
      bookKey: string | null,
      bookValue: string | null
    },
    { ... }, { ... }, ...
  ],
  collection: object[] | null
  [
    {
      library: string,
      callNumber: string,
      status: string
    },
    { ... }, { ... }, ...
  ],
  url: string,
};

// If you get two or more results, it will return an "array".
result = [
  {
    ...  // This result is the same as above.
  },
  { ... }, { ... }, ...
];

// If you have not got any result, it will return a "null".
result = null;