Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ytsearcher

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ytsearcher - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

21

lib/struct/YTSearch.js

@@ -13,3 +13,3 @@ 'use strict';

const querystring = require('querystring');
const { get } = require('snekfetch');
const { get } = require('https');
const Constants = require('../deps/Constants');

@@ -90,5 +90,20 @@ const { YTSearchPage } = require('./YTSearchPage');

const queryUrl = `${apiurl}${querystring.stringify(searchParams)}`;
const promise = new Promise((_res, _rej) => get(queryUrl, response => {
if (response.statusCode !== 200) {
response.resume();
return _rej(new Error(`Error code: ${response.statusCode}`));
}
let chunks = [];
response.on('data', chunk => chunks.push(chunk));
return response.on('end', () => {
try {
const buf = Buffer.concat(chunks);
return _res({ body: JSON.parse(buf) });
} catch (err) {
return _rej(err);
}
});
}));
get(queryUrl).then(response => {
if (response.statusCode !== 200) return rej(new Error(`Error code: ${response.statusCode}`));
promise.then(response => {
const body = response.body;

@@ -95,0 +110,0 @@ if (body.error) return rej(new Error(body.error.message));

13

package.json
{
"name": "ytsearcher",
"version": "1.1.3",
"version": "1.2.0",
"description": "A nodejs package that provides an easy-to-use promise-based system of getting youtube search results",

@@ -19,7 +19,9 @@ "main": "index.js",

"keywords": [
"Promise-Based",
"YouTube",
"Searcher",
"ytsearcher",
"Pagination"
"Pagination",
"Promise",
"modern",
"es6"
],

@@ -32,6 +34,3 @@ "author": "William Zhou",

"homepage": "https://wzhouwzhou.github.io/ytsearcher/",
"dependencies": {
"querystring": "^0.2.0",
"snekfetch": "^4.0.2"
}
"dependencies": {}
}

@@ -8,2 +8,3 @@ <div align="center">

<a href="https://david-dm.org/wzhouwzhou/ytsearcher"><img src="https://img.shields.io/david/wzhouwzhou/ytsearcher.svg" alt="Dependencies" /></a>
<a href="https://snyk.io/test/npm/ytsearcher"><img src="https://snyk.io/test/npm/ytsearcher/badge.svg" alt="Known Vulnerabilities" data-canonical-src="https://snyk.io/test/npm/ytsearcher" style="max-width:100%;"></a>
<a href="https://paypal.me/wzhouwzhou"><img src="https://img.shields.io/badge/donate-paypal-009cde.svg" alt="Paypal" /></a>

@@ -21,5 +22,12 @@ </p>

```$ npm install ytsearcher```
```$ npm install ytsearcher@1.2.0```
### Quick Start Guide
### Why ytsearcher?
• Modern and trustworthy (promises, es6, up-to-date) with thousands of downloads.
• Lightweight (packed size < 10kB) and NO other dependencies; this means **more productivity, less bloat**!
### I'm all about that! How do I start searching YouTube the right way?
**Creating the object:**

@@ -138,1 +146,7 @@

Full docs are available here: [http://ytsearcher.willyz.cf](https://ytsearcher.willyz.cf)
Enjoy this package? Consider starring on [github](https://github.com/wzhouwzhou/ytsearcher) and checking out some of my other work:
[Fluent Filepaths](https://npmjs.com/easypathutil)
[Urban Dictionary](https://npmjs.com/easyurban)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc