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

tvgh-library-collection-crawler

v1.1.2

Published

Taipei Veterans General Hospital Medical Library Collection crawler

Downloads

2

Readme

Taipei Veterans General Hospital Medical Library Collection Crawler

NPM version Actions status Codecov status Scheduled status Dependencies status Code style License MIT

臺北榮民總醫院醫學圖書館館藏資料爬蟲

Requirements

  • This construct uses XHR such as Axios.js, so you need to care about the Cross-Origin Requests (CORS) if you use this construct in web browsers rather than Node.js.

Installations

  • NPM
npm install tvgh-library-collection-crawler --save
  • Yarn
yarn add tvgh-library-collection-crawler

Usage

Node.js version 8 or higher (with full Async/Await support)

const tvghLibraryCollectionCrawler = require('tvgh-library-collection-crawler');

const run = async () => {
  const results = await tvghLibraryCollectionCrawler('橡皮擦計畫');
  console.log(results);
};

run();

Others

const tvghLibraryCollectionCrawler = require('tvgh-library-collection-crawler');

tvghLibraryCollectionCrawler('橡皮擦計畫')
  .then(results => console.log(results));

Demo

Commands

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

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

Results

>>> You search data using keyword "橡皮擦計畫".

{
  title: '橡皮擦計畫 : 兩位天才心理學家,一段改變世界的情誼',
  author: 'Lewis, Michael,',
  isbn: '9789866613944',
  issn: null,
  edition: '初版',
  pub_year: '2018',
  pub_place: '台北市 : 早安財經文化有限公司,',
  pub_info: null,
  shape: '383面 ; 21公分',
  collection: [
    {
      library: '北榮',
      data_type: '*圖書',
      special_number: '',
      barcode: '00000253649',
      call_number: '170.1/8857/2018',
      is_flow: true,
      status: '正在查詢...'
    }
  ],
  url: 'http://tghtpe.ent.sirsidynix.net/client/zh_TW/vgh/search/results?qu=%E6%A9%A1%E7%9A%AE%E6%93%A6%E8%A8%88%E7%95%AB&rw=0&lm=VGHTPE'
}
>>> You search data using keyword "Alzheimer disease".

[ {...}, {...}, ... ] # Array.prototype.length <= 12
>>> You search data using keyword "no-result-as-example".

null

API documentation

Input parameters

import tvghLibraryCollectionCrawler from 'tvgh-library-collection-crawler';

const result = tvghLibraryCollectionCrawler(
  keyword, // string. Necessary.
           // If you set it as null, it will get an error.
  page, // number. Positive integer. Default: 1.
        // Every page only shows maximum 12 results.
  libraryNumbering, // number. Integer and the range from 0 to 7 are valid. Default: 0.
                    // Each number represents a different library, as follows:
                    // 0: VGHTPE 臺北總院
                    // 1: GANDAU 關渡分院
                    // 2: FLVH   鳳林分院
                    // 3: SAVH   蘇澳分院
                    // 4: TYVH   桃園分院
                    // 5: VHCT   新竹分院
                    // 6: VHTT   臺東分院
                    // 7: VHYL   玉里分院
                    // 8: YSVH   員山分院
)

Output results

// If you get one result, it will return an "object".
result = {
  title: string | null,
  author: string | null,
  isbn: string | null,
  issn: string | null,
  edition: string | null,
  pub_year: string | null,
  pub_place: string | null,
  pub_info: string | null,
  shape: string | null,
  collection: object[]
    [
      {
        library: string | null,
        data_type: string | null,
        special_number: string | null,
        barcode: string | null,
        call_number: string | null,
        is_flow: boolean,
        status: '正在查詢...' | null // You always get this result because the text is pre-rendering.
      },
      { ... }, { ... }, ...
    ],
  url: string | null,
};

// 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;