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

eslite-com-crawler

v1.1.1

Published

eslite-com crawler

Downloads

6

Readme

The official website has provided its own API, so you do NOT need to use this package.

官方網站已提供它們自己的 API,所以你不需要使用這個套件。

Eslite-com Crawler

NPM version Actions status Codecov 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) and mixed content if you use this construct in web browsers rather than Node.js.

Installations

  • NPM
npm install eslite-com-crawler --save
  • Yarn
yarn add eslite-com-crawler

Usage

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

const esliteComCrawler = require('eslite-com-crawler');

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

run();

Others

const esliteComCrawler = require('eslite-com-crawler');

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

Demo

Commands

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

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

Results

>>> You search data using keyword "文學少女".

[
  {
    title: '文學少女十年有成紀念套書 (16冊合售)',
    url: 'https://www.eslite.com/product/1001125622613420',
    author: [ '野村美月' ],
    publisher: [ '尖端出版' ],
    publicationDate: '2017-08-14T00:00:00Z',
    imageUrl: 'https://s.eslite.dev/upload/product/m/2681485623007/707488.jpg',
    price: { discount: 90, currentPrice: 2700 },
    introduction: '●女主角天野遠子榮獲2009年「這本輕小說最厲害」角色排行第一名。 ●繪者竹岡美穗連續七年登上「這本輕小說最厲害」年度插圖排行前十名。 ●作者野村美月曾獲第三回ENTAME大賞小說部門最優秀獎。 ●日本AMAZON網路書店讀者對此系列每本都有四到五顆星的高評價。 ●紀念套書經作者野村美月認可,書衣全新選圖設計。 ●書衣使用能展現繪者竹岡美穗夢幻手感的珠光墨印刷。 ●特殊書背設計,書籍併排可以拼湊出一張完整的遠子學姊美圖。 ●絕對稀有的四十張紀念藏書票,可以宣示您對書籍的所有權。 ●全新書衣:每一本書的書衣皆經野村美月老師認可重新挑選圖像製作,書背部分更是捨棄傳統書名的列示,透過特別設計,當十六本書併排時,便可以看到一張完整的遠子學姊美圖。 ●質感印刷:書衣印刷也有別於傳統四色印刷,加碼使用能襯托出竹岡美穗老師夢幻手感的珠光墨印製。 ●稀有藏書票:精心挑選四十張圖製作的「文學少女十年有成紀念'
  },
  [ {...}, {...}, ... ] # Array.prototype.length <= 20
]
>>> You search data using keyword "blablablablablablablablablablablabla".

null

API documentation

Input parameters

import esliteComCrawler from 'eslite-com-crawler'; // Here uses development mode as an example

const result = esliteComCrawler(
  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 20 results.
)

Output results

// If you get one or more result(s), it will return an "array".
result = [
  {
    title: string,
    author: string[],
    publisher: string[],
    publicationDate: string,
    imageUrl: string | null,
    introduction: string,
    price: {
      discount: number,
      currentPrice: number,
    },
    url: string,
  },
  { ... }, { ... }, ...
];

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