summaly
Get any web page's summary synchronously. Try it out
❕❕ NOTICE ❕❕
This is synchronized package.
DON'T USE THIS PACKAGE without where you had better need to write synchronously in your product app.
It is more preferable to REWRITE YOUR CODE Asynchronously with USING the FOLLOWING package.
これは同期化されたパッケージです。
製品のアプリケーションで同期的に書く必要に迫られている場所を除き、このパッケージを利用しないでください。
以下のパッケージを利用しながら、非同期的にコードを書き換えることが望ましいです。
https://github.com/syuilo/summaly
Installation
$ npm install sync-summaly
Usage
Options
Property | Type | Description | Default |
---|---|---|---|
followRedirects | boolean | Whether follow redirects | true |
plugins | plugin[] (see below) | Custom plugins | null |
Plugin
Returns
A Promise of an Object that contains properties below:
Property | Type | Description |
---|---|---|
description | string | The description of the web page |
icon | string | The url of the icon of the web page |
sitename | string | The name of the web site |
thumbnail | string | The url of the thumbnail of the web page |
title | string | The title of the web page |
url | string | The url of the web page |
Example
Node.js
const summaly = defaultconst summary = ;console;
TypeScript
;;console.logsummary;
Result
// will be... title: 'クレイジーカルテット' icon: 'https://dic.pixiv.net/favicon.ico' description: '「クレイジーカルテット」とは、東方Projectに登場するフランドール・スカーレット、古明地こいし、封獣ぬえ、鬼人正邪の四名による二次創作グループである。' thumbnail: 'https://i.pximg.net/c/150x150/img-master/img/2014/12/05/19/15/18/47411920_p0_master1200.jpg' sitename: 'ピクシブ百科事典' url: 'https://dic.pixiv.net/a/%E3%82%AF%E3%83%AC%E3%82%A4%E3%82%B8%E3%83%BC%E3%82%AB%E3%83%AB%E3%83%86%E3%83%83%E3%83%88'
Testing
npm run test