Skip to content

Commit 9ccd5c9

Browse files
committed
Update docs and actions for v2.
1 parent c3b4138 commit 9ccd5c9

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Release
22
on:
33
push:
44
branches:
5-
- main
5+
- master
66
jobs:
77
release:
88
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
# google-news-scraper CHANGELOG
33
All notable changes to this project will be documented in this file.
44

5+
## [2.0.0] - 2024-10-27
6+
7+
To update please run `npm update google-news-scraper`
8+
9+
### Changed
10+
11+
- Added support for both ESM and CJS.
12+
- Added TypeScript support.
13+
- Integrated Rollup to make shipping easier.
14+
- Added release action, to bump version and ship to NPM every time we push to `master` branch`.
15+
516
## [1.2.2] - 2024-03-18
617

718
To update please run `npm update google-news-scraper`

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ A lightweight package that scrapes article data from [Google News](https://news.
1010
* [Usage](#usage-%EF%B8%8F)
1111
* [Output](#output-)
1212
* [Config](#config-%EF%B8%8F)
13+
* [TypeScript](#typescript-)
14+
* [CommonJS](#common-js-)
1315
* [Performance](#performance-)
1416
* [Upkeep](#upkeep-)
1517
* [Bugs](#bugs-)
@@ -30,7 +32,7 @@ yarn add google-news-scraper
3032
## Usage 🕹️
3133
Simply import the package and pass a config object.
3234
```javascript
33-
const googleNewsScraper = require('google-news-scraper');
35+
import googleNewsScraper from 'google-news-scraper';
3436

3537
const articles = await googleNewsScraper({ searchTerm: "The Oscars" });
3638

@@ -145,6 +147,20 @@ Whether or not Puppeteer should run in [headless mode](https://www.browserstack.
145147

146148
Defaults to `true`
147149

150+
## TypeScript 💙
151+
Google News Scraper includes full [TypeScript](https://typescriptlang.org/) definitions.
152+
153+
Your IDE should pick the types up automatically, but if not you can find them in the `dist/tsc/` folder.
154+
155+
## Common JS 👴🏻
156+
Google News Scraper is built to work as an [ESM module](https://nodejs.org/api/esm.html) out of the box, but also works as a [Common JS module](https://nodejs.org/api/modules.html) too, just use `require` instead of `import`:
157+
```javascript
158+
const googleNewsScraper = require('google-news-scraper');
159+
160+
const articles = await googleNewsScraper({ searchTerm: "The Oscars" });
161+
162+
```
163+
148164
## Performance 📈
149165
My test query returned 94 results, which took 4.5 seconds with article content and 3.6 seconds without it. I'm on a fibre connection, and other queries may return a different number of results, so your mileage may vary.
150166

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "google-news-scraper",
3-
"version": "2.0.0-alpha.7",
3+
"version": "2.0.0",
44
"description": "Lightweight async scraper for Google News",
55
"main": "./dist/cjs/index.js",
66
"module": "./dist/esm/index.mjs",

0 commit comments

Comments
 (0)