duck-duck-scrape
Advanced tools
Comparing version 1.0.3 to 2.0.0
{ | ||
"name": "duck-duck-scrape", | ||
"version": "1.0.3", | ||
"description": "A DuckDuckGo scraper for Node.js.", | ||
"main": "index.js", | ||
"version": "2.0.0", | ||
"description": "Search from DuckDuckGo and use it's spice APIs.", | ||
"main": "./lib/index.js", | ||
"types": "./lib/index.d.ts", | ||
"author": "Snazzah", | ||
"contributors": [ | ||
"suushii" | ||
], | ||
"license": "MIT", | ||
"repository": "https://github.com/Snazzah/duck-duck-scrape", | ||
"homepage": "https://duck-duck-scrape.js.org/", | ||
"keywords": [ | ||
"duckduckgo", | ||
"ddg", | ||
"search", | ||
"api" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/Snazzah/duck-duck-scrape/issues" | ||
}, | ||
"funding": { | ||
"url": "https://github.com/sponsors/Snazzah" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"build": "([ ! -d \"lib/\" ] || rm -r lib/*) && npx tsc", | ||
"build:prepare": "[ -d \"lib/\" ] || npm run build", | ||
"changelog": "ts-node scripts/changelog", | ||
"lint": "npx eslint --ext .ts ./src", | ||
"lint:fix": "npx eslint --ext .ts ./src --fix", | ||
"test": "mocha -r ts-node/register --extension ts", | ||
"gpr": "ts-node scripts/gpr", | ||
"docs": "typedoc", | ||
"prepare": "npx husky install && npm run build:prepare", | ||
"prepublishOnly": "([ -d \"lib/\" ] || (echo \"lib folder does not exist\" && exit 1)) && npm run lint:fix" | ||
}, | ||
"keywords": [ | ||
"duckduckgo" | ||
], | ||
"author": "suushii <suushii@protonmail.com> (https://suushii.github.io)", | ||
"contributors": [ | ||
"Snazzah" | ||
], | ||
"license": "ISC", | ||
"lint-staged": { | ||
"*.ts": "eslint --fix" | ||
}, | ||
"dependencies": { | ||
"cheerio": "^1.0.0-rc.2", | ||
"mustache": "^2.3.0", | ||
"snekfetch": "^3.6.4" | ||
"html-entities": "^2.3.2", | ||
"needle": "^2.6.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/suushii/duck-duck-scrape.git" | ||
"devDependencies": { | ||
"@types/needle": "^2.5.1", | ||
"@types/node": "^14.14.22", | ||
"@typescript-eslint/eslint-plugin": "^4.14.1", | ||
"@typescript-eslint/parser": "^4.14.1", | ||
"eslint": "^7.18.0", | ||
"eslint-config-prettier": "^8.0.0", | ||
"eslint-plugin-prettier": "^3.3.1", | ||
"husky": "^6.0.0", | ||
"lint-staged": "^10.5.4", | ||
"prettier": "^2.2.1", | ||
"ts-node": "^9.1.1", | ||
"typedoc": "^0.20.35", | ||
"typescript": "^4.1.3", | ||
"yarn": "^1.22.10" | ||
} | ||
} | ||
} |
@@ -1,24 +0,75 @@ | ||
# duck-duck-scrape | ||
A DuckDuckGo scraper NPM module | ||
<div align="center"> | ||
**Note: This isn't endorsed by DuckDuckGo in any way.** | ||
[![](https://get.snaz.in/45RrSvq.png)](https://duck-duck-scrape.js.org/) | ||
[![NPM](https://nodei.co/npm/duck-duck-scrape.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/duck-duck-scrape/) | ||
[![NPM version](https://img.shields.io/npm/v/duck-duck-scrape?maxAge=3600?&color=3498db)](https://www.npmjs.com/package/dexare) [![NPM downloads](https://img.shields.io/npm/dt/duck-duck-scrape?maxAge=3600&color=3498db)](https://www.npmjs.com/package/dexare) [![ESLint status](https://github.com/Snazzah/duck-duck-scrape/workflows/ESLint/badge.svg)](https://github.com/Dexare/Dexare/actions?query=workflow%3A%22ESLint%22) [![DeepScan grade](https://deepscan.io/api/teams/11596/projects/16764/branches/365136/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=11596&pid=16764&bid=365136) | ||
# Installation | ||
`npm install --save duck-duck-scrape` | ||
`npm install duck-duck-scrape` - `yarn add duck-duck-scrape` | ||
# Setup | ||
```javascript | ||
const DuckDuckScrape = require("duck-duck-scrape"); | ||
const ddg = new DuckDuckScrape(); | ||
Search from DuckDuckGo and utilize its spice APIs for things such as stocks, weather, currency conversion and more! | ||
</div> | ||
### Available Features | ||
- Search | ||
- Regular search | ||
- Image search | ||
- Video search | ||
- News search | ||
- Stocks (via Xignite) | ||
- Time for Location API (via timeanddate.com) | ||
- Currency Conversion (via XE) | ||
- Forecast (via Dark Sky) | ||
- Dictionary | ||
- Definition | ||
- Audio | ||
- Pronunciation | ||
- Hyphenation | ||
### Quickstart | ||
#### JavaScript | ||
```js | ||
const DDG = require('duck-duck-scrape'); | ||
const searchResults = await DDG.search('node.js', { | ||
safeSearch: DDG.SafeSearchType.STRICT | ||
}); | ||
// DDG.stocks('aapl') | ||
// DDG.currency('usd', 'eur', 1) | ||
// DDG.dictionaryDefinition('happy') | ||
console.log(searchResults); | ||
/** | ||
{ | ||
noResults: false, | ||
vqd: '3-314...', | ||
results: [ | ||
{ | ||
title: 'Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript...', | ||
... | ||
url: 'https://nodejs.org/', | ||
bang: { | ||
prefix: 'node', | ||
title: 'node.js docs', | ||
domain: 'nodejs.org' | ||
} | ||
}, | ||
... | ||
] | ||
} | ||
*/ | ||
``` | ||
# Documentation | ||
https://suushii.github.io/duck-duck-scrape/index.html | ||
#### TypeScript | ||
```js | ||
import { search, SafeSearchType } from 'duck-duck-scrape'; | ||
// import * as DDG from 'duck-duck-scrape'; | ||
# Attribution | ||
const searchResults = await search('node.js', { | ||
safeSearch: SafeSearchType.STRICT | ||
}); | ||
``` | ||
Original code by Snazzah | ||
Packaged by suushii |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 10 instances in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
2
49
0
3540
0
0
76
2
128751
14
1
+ Addedhtml-entities@^2.3.2
+ Addedneedle@^2.6.0
+ Addeddebug@3.2.7(transitive)
+ Addedhtml-entities@2.5.2(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedms@2.1.3(transitive)
+ Addedneedle@2.9.1(transitive)
+ Addedsax@1.4.1(transitive)
- Removedcheerio@^1.0.0-rc.2
- Removedmustache@^2.3.0
- Removedsnekfetch@^3.6.4
- Removedboolbase@1.0.0(transitive)
- Removedcheerio@1.0.0(transitive)
- Removedcheerio-select@2.1.0(transitive)
- Removedcss-select@5.1.0(transitive)
- Removedcss-what@6.1.0(transitive)
- Removeddom-serializer@2.0.0(transitive)
- Removeddomelementtype@2.3.0(transitive)
- Removeddomhandler@5.0.3(transitive)
- Removeddomutils@3.1.0(transitive)
- Removedencoding-sniffer@0.2.0(transitive)
- Removedentities@4.5.0(transitive)
- Removedhtmlparser2@9.1.0(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedmustache@2.3.2(transitive)
- Removednth-check@2.1.1(transitive)
- Removedparse5@7.2.1(transitive)
- Removedparse5-htmlparser2-tree-adapter@7.1.0(transitive)
- Removedparse5-parser-stream@7.1.2(transitive)
- Removedsnekfetch@3.6.4(transitive)
- Removedundici@6.21.0(transitive)
- Removedwhatwg-encoding@3.1.1(transitive)
- Removedwhatwg-mimetype@4.0.0(transitive)