Comparing version 0.0.19 to 0.0.20
@@ -1,3 +0,1 @@ | ||
import { NodeFetchClientAdapter } from "./adapters/NodeFetchClientAdapter"; | ||
import { NodeFSStorageAdapater } from "./adapters/NodeFSStorageAdapter"; | ||
import { Explorer } from "./fetchers/Explorer"; | ||
@@ -20,6 +18,4 @@ import { ContinuatedList } from "./fetchers/ContinuatedList"; | ||
import { CaptionTrack } from "./interfaces/CaptionTrack"; | ||
import { default as IYoutube } from "./Iyoutube"; | ||
import { default as IYoutube } from "./IYoutube"; | ||
export { IYoutube as IYoutube }; | ||
export { NodeFSStorageAdapater as NodeFSStorageAdapater }; | ||
export { NodeFetchClientAdapter as NodeFetchClientAdapter }; | ||
export { HTTPClient as HTTPClient }; | ||
@@ -42,2 +38,2 @@ export { StorageAdapter as StorageAdapter }; | ||
export { CaptionTrack as CaptionTrack }; | ||
export declare const nodeInst: IYoutube; | ||
export declare const nodeDefault: () => Promise<IYoutube>; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.nodeInst = exports.CommentThreadRepliesContinuatedList = exports.CommentThread = exports.Comment = exports.CommentSectionContinuatedList = exports.Playlist = exports.Video = exports.Channel = exports.Authenticator = exports.ContinuatedList = exports.User = exports.Explorer = exports.WrappedHTTPClient = exports.NodeFetchClientAdapter = exports.NodeFSStorageAdapater = exports.IYoutube = void 0; | ||
const NodeFetchClientAdapter_1 = require("./adapters/NodeFetchClientAdapter"); | ||
Object.defineProperty(exports, "NodeFetchClientAdapter", { enumerable: true, get: function () { return NodeFetchClientAdapter_1.NodeFetchClientAdapter; } }); | ||
const NodeFSStorageAdapter_1 = require("./adapters/NodeFSStorageAdapter"); | ||
Object.defineProperty(exports, "NodeFSStorageAdapater", { enumerable: true, get: function () { return NodeFSStorageAdapter_1.NodeFSStorageAdapater; } }); | ||
exports.nodeDefault = exports.CommentThreadRepliesContinuatedList = exports.CommentThread = exports.Comment = exports.CommentSectionContinuatedList = exports.Playlist = exports.Video = exports.Channel = exports.Authenticator = exports.ContinuatedList = exports.User = exports.Explorer = exports.WrappedHTTPClient = exports.IYoutube = void 0; | ||
const Explorer_1 = require("./fetchers/Explorer"); | ||
@@ -32,5 +37,9 @@ Object.defineProperty(exports, "Explorer", { enumerable: true, get: function () { return Explorer_1.Explorer; } }); | ||
Object.defineProperty(exports, "CommentThreadRepliesContinuatedList", { enumerable: true, get: function () { return CommentThreadRepliesContinuatedList_1.CommentThreadRepliesContinuatedList; } }); | ||
const Iyoutube_1 = require("./Iyoutube"); | ||
Object.defineProperty(exports, "IYoutube", { enumerable: true, get: function () { return Iyoutube_1.default; } }); | ||
const path = require("path"); | ||
exports.nodeInst = new Iyoutube_1.default(new NodeFetchClientAdapter_1.NodeFetchClientAdapter(), new NodeFSStorageAdapter_1.NodeFSStorageAdapater(path.resolve(__dirname, "../datastorage"))); | ||
const IYoutube_1 = require("./IYoutube"); | ||
Object.defineProperty(exports, "IYoutube", { enumerable: true, get: function () { return IYoutube_1.default; } }); | ||
const nodeDefault = () => __awaiter(void 0, void 0, void 0, function* () { | ||
const path = "./nodeDefault"; | ||
const res = yield Promise.resolve().then(() => require(path)); | ||
return res.default; | ||
}); | ||
exports.nodeDefault = nodeDefault; |
{ | ||
"name": "iyoutube", | ||
"version": "0.0.19", | ||
"version": "0.0.20", | ||
"description": "The ultimate unofficial YouTube API Client for Javascript", | ||
@@ -5,0 +5,0 @@ "main": "output/main.js", |
@@ -1,3 +0,1 @@ | ||
import { NodeFetchClientAdapter } from "./adapters/NodeFetchClientAdapter"; | ||
import { NodeFSStorageAdapater } from "./adapters/NodeFSStorageAdapter"; | ||
import { Explorer } from "./fetchers/Explorer"; | ||
@@ -20,8 +18,6 @@ import { ContinuatedList } from "./fetchers/ContinuatedList"; | ||
import { CaptionTrack } from "./interfaces/CaptionTrack"; | ||
import { default as IYoutube } from "./Iyoutube"; | ||
import { default as IYoutube } from "./IYoutube"; | ||
export { IYoutube as IYoutube } | ||
export { NodeFSStorageAdapater as NodeFSStorageAdapater } | ||
export { NodeFetchClientAdapter as NodeFetchClientAdapter } | ||
export { HTTPClient as HTTPClient } | ||
@@ -47,4 +43,7 @@ export { StorageAdapter as StorageAdapter } | ||
//Default Export for most NodeJS | ||
import * as path from 'path'; | ||
export const nodeInst = new IYoutube(new NodeFetchClientAdapter() , new NodeFSStorageAdapater(path.resolve(__dirname, "../datastorage"))); | ||
//Skips Webpack checks | ||
export const nodeDefault = async ():Promise<IYoutube> => { | ||
const path = "./nodeDefault"; | ||
const res = await import(path); | ||
return res.default; | ||
} |
@@ -1,8 +0,11 @@ | ||
//Import the nodeInst Export of IYoutube | ||
//This export is already filled with an Storage Adapter and HTTPClient | ||
//If you just want to use this Library generally with NodeJS you can ignore what this means | ||
const ytClient = require("../").nodeInst; | ||
// !IMPORTANT! You have to replace the ../ with IYoutube | ||
/* Import Library */ | ||
const iyoutube = require("../"); | ||
//OR ESM: | ||
//import * as iyoutube from 'iyoutube'; | ||
(async function() { | ||
//Get new Instance for Node.JS (! REQUIRES ASYNC USAGE !) | ||
const ytClient = await iyoutube.nodeDefault(); | ||
//Init the Client | ||
@@ -9,0 +12,0 @@ await ytClient.init(); |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
213059
93
4155
2