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

imdb-api

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imdb-api - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

535

defs/node.d.ts

@@ -15,13 +15,2 @@ /************************************************

declare var console: {
log(...data: any[]): void;
info(...data: any[]): void;
error(...data: any[]): void;
warn(...data: any[]): void;
dir(obj: any): void;
timeEnd(label: string): void;
trace(label: string): void;
assert(expression: any, ...message: string[]): void;
}
declare var __filename: string;

@@ -31,5 +20,7 @@ declare var __dirname: string;

declare function setTimeout(callback: () => void , ms: number): any;
declare function clearTimeout(timeoutId: any);
declare function clearTimeout(timeoutId: any): void;
declare function setInterval(callback: () => void , ms: number): any;
declare function clearInterval(intervalId: any);
declare function clearInterval(intervalId: any): void;
declare function setImmediate(callback: () => void ): any;
declare function clearImmediate(immediateId: any): void;

@@ -41,2 +32,3 @@ declare var require: {

extensions: any;
main: any;
}

@@ -49,3 +41,3 @@

filename: string;
loaded: bool;
loaded: boolean;
parent: any;

@@ -62,3 +54,3 @@ children: any[];

prototype: NodeBuffer;
isBuffer(obj: any): bool;
isBuffer(obj: any): boolean;
byteLength(string: string, encoding?: string): number;

@@ -72,3 +64,3 @@ concat(list: NodeBuffer[], totalLength?: number): NodeBuffer;

prototype: NodeBuffer;
isBuffer(obj: any): bool;
isBuffer(obj: any): boolean;
byteLength(string: string, encoding?: string): number;

@@ -85,16 +77,16 @@ concat(list: NodeBuffer[], totalLength?: number): NodeBuffer;

interface EventEmitter {
addListener(event: string, listener: Function);
on(event: string, listener: Function);
once(event: string, listener: Function): void;
removeListener(event: string, listener: Function): void;
removeAllListener(event: string): void;
addListener(event: string, listener: Function): EventEmitter;
on(event: string, listener: Function): EventEmitter;
once(event: string, listener: Function): EventEmitter;
removeListener(event: string, listener: Function): EventEmitter;
removeAllListeners(event?: string): EventEmitter;
setMaxListeners(n: number): void;
listeners(event: string): { Function; }[];
emit(event: string, arg1?: any, arg2?: any): void;
listeners(event: string): Function[];
emit(event: string, ...args: any[]): boolean;
}
interface WritableStream extends EventEmitter {
writable: bool;
write(str: string, encoding?: string, fd?: string): bool;
write(buffer: NodeBuffer): bool;
writable: boolean;
write(str: string, encoding?: string, fd?: string): boolean;
write(buffer: NodeBuffer): boolean;
end(): void;

@@ -108,3 +100,3 @@ end(str: string, enconding: string): void;

interface ReadableStream extends EventEmitter {
readable: bool;
readable: boolean;
setEncoding(encoding: string): void;

@@ -114,3 +106,3 @@ pause(): void;

destroy(): void;
pipe(destination: WritableStream, options?: { end?: bool; }): void;
pipe(destination: WritableStream, options?: { end?: boolean; }): void;
}

@@ -126,3 +118,3 @@

chdir(directory: string): void;
cwd(): void;
cwd(): string;
env: any;

@@ -149,14 +141,14 @@ exit(code?: number): void;

host_arch: string;
node_install_npm: bool;
node_install_waf: bool;
node_install_npm: boolean;
node_install_waf: boolean;
node_prefix: string;
node_shared_openssl: bool;
node_shared_v8: bool;
node_shared_zlib: bool;
node_use_dtrace: bool;
node_use_etw: bool;
node_use_openssl: bool;
node_shared_openssl: boolean;
node_shared_v8: boolean;
node_shared_zlib: boolean;
node_use_dtrace: boolean;
node_use_etw: boolean;
node_use_openssl: boolean;
target_arch: string;
v8_no_strict_aliasing: number;
v8_use_snapshot: bool;
v8_use_snapshot: boolean;
visibility: string;

@@ -170,7 +162,7 @@ };

platform: string;
memoryUsage(): { rss: number; heapTotal; number; heapUsed: number; };
memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; };
nextTick(callback: Function): void;
umask(mask?: number): number;
uptime(): number;
hrtime(): number[];
hrtime(time?:number[]): number[];
}

@@ -184,32 +176,32 @@

length: number;
copy(targetBuffer: NodeBuffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): void;
copy(targetBuffer: NodeBuffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
slice(start?: number, end?: number): NodeBuffer;
readUInt8(offset: number, noAsset?: bool): number;
readUInt16LE(offset: number, noAssert?: bool): number;
readUInt16BE(offset: number, noAssert?: bool): number;
readUInt32LE(offset: number, noAssert?: bool): number;
readUInt32BE(offset: number, noAssert?: bool): number;
readInt8(offset: number, noAssert?: bool): number;
readInt16LE(offset: number, noAssert?: bool): number;
readInt16BE(offset: number, noAssert?: bool): number;
readInt32LE(offset: number, noAssert?: bool): number;
readInt32BE(offset: number, noAssert?: bool): number;
readFloatLE(offset: number, noAssert?: bool): number;
readFloatBE(offset: number, noAssert?: bool): number;
readDoubleLE(offset: number, noAssert?: bool): number;
readDoubleBE(offset: number, noAssert?: bool): number;
writeUInt8(value: number, offset: number, noAssert?: bool): void;
writeUInt16LE(value: number, offset: number, noAssert?: bool): void;
writeUInt16BE(value: number, offset: number, noAssert?: bool): void;
writeUInt32LE(value: number, offset: number, noAssert?: bool): void;
writeUInt32BE(value: number, offset: number, noAssert?: bool): void;
writeInt8(value: number, offset: number, noAssert?: bool): void;
writeInt16LE(value: number, offset: number, noAssert?: bool): void;
writeInt16BE(value: number, offset: number, noAssert?: bool): void;
writeInt32LE(value: number, offset: number, noAssert?: bool): void;
writeInt32BE(value: number, offset: number, noAssert?: bool): void;
writeFloatLE(value: number, offset: number, noAssert?: bool): void;
writeFloatBE(value: number, offset: number, noAssert?: bool): void;
writeDoubleLE(value: number, offset: number, noAssert?: bool): void;
writeDoubleBE(value: number, offset: number, noAssert?: bool): void;
readUInt8(offset: number, noAsset?: boolean): number;
readUInt16LE(offset: number, noAssert?: boolean): number;
readUInt16BE(offset: number, noAssert?: boolean): number;
readUInt32LE(offset: number, noAssert?: boolean): number;
readUInt32BE(offset: number, noAssert?: boolean): number;
readInt8(offset: number, noAssert?: boolean): number;
readInt16LE(offset: number, noAssert?: boolean): number;
readInt16BE(offset: number, noAssert?: boolean): number;
readInt32LE(offset: number, noAssert?: boolean): number;
readInt32BE(offset: number, noAssert?: boolean): number;
readFloatLE(offset: number, noAssert?: boolean): number;
readFloatBE(offset: number, noAssert?: boolean): number;
readDoubleLE(offset: number, noAssert?: boolean): number;
readDoubleBE(offset: number, noAssert?: boolean): number;
writeUInt8(value: number, offset: number, noAssert?: boolean): void;
writeUInt16LE(value: number, offset: number, noAssert?: boolean): void;
writeUInt16BE(value: number, offset: number, noAssert?: boolean): void;
writeUInt32LE(value: number, offset: number, noAssert?: boolean): void;
writeUInt32BE(value: number, offset: number, noAssert?: boolean): void;
writeInt8(value: number, offset: number, noAssert?: boolean): void;
writeInt16LE(value: number, offset: number, noAssert?: boolean): void;
writeInt16BE(value: number, offset: number, noAssert?: boolean): void;
writeInt32LE(value: number, offset: number, noAssert?: boolean): void;
writeInt32BE(value: number, offset: number, noAssert?: boolean): void;
writeFloatLE(value: number, offset: number, noAssert?: boolean): void;
writeFloatBE(value: number, offset: number, noAssert?: boolean): void;
writeDoubleLE(value: number, offset: number, noAssert?: boolean): void;
writeDoubleBE(value: number, offset: number, noAssert?: boolean): void;
fill(value: any, offset?: number, end?: number): void;

@@ -233,28 +225,30 @@ INSPECT_MAX_BYTES: number;

export interface NodeEventEmitter {
addListener(event: string, listener: Function);
on(event: string, listener: Function): any;
once(event: string, listener: Function): void;
removeListener(event: string, listener: Function): void;
removeAllListener(event: string): void;
addListener(event: string, listener: Function): NodeEventEmitter;
on(event: string, listener: Function): NodeEventEmitter;
once(event: string, listener: Function): NodeEventEmitter;
removeListener(event: string, listener: Function): NodeEventEmitter;
removeAllListeners(event?: string): NodeEventEmitter;
setMaxListeners(n: number): void;
listeners(event: string): { Function; }[];
emit(event: string, arg1?: any, arg2?: any): void;
listeners(event: string): Function[];
emit(event: string, ...args: any[]): boolean;
}
export class EventEmitter implements NodeEventEmitter {
addListener(event: string, listener: Function);
on(event: string, listener: Function): any;
once(event: string, listener: Function): void;
removeListener(event: string, listener: Function): void;
removeAllListener(event: string): void;
static listenerCount(emitter: EventEmitter, event: string): number;
addListener(event: string, listener: Function): EventEmitter;
on(event: string, listener: Function): EventEmitter;
once(event: string, listener: Function): EventEmitter;
removeListener(event: string, listener: Function): EventEmitter;
removeAllListeners(event?: string): EventEmitter;
setMaxListeners(n: number): void;
listeners(event: string): { Function; }[];
emit(event: string, arg1?: any, arg2?: any): void;
}
listeners(event: string): Function[];
emit(event: string, ...args: any[]): boolean;
}
}
declare module "http" {
import events = module("events");
import net = module("net");
import stream = module("stream");
import events = require("events");
import net = require("net");
import stream = require("stream");

@@ -271,3 +265,3 @@ export interface Server extends events.NodeEventEmitter {

url: string;
headers: string;
headers: any;
trailers: string;

@@ -282,4 +276,4 @@ httpVersion: string;

// Extended base methods
write(str: string, encoding?: string, fd?: string): bool;
write(buffer: NodeBuffer): bool;
write(str: string, encoding?: string, fd?: string): boolean;
write(buffer: NodeBuffer): boolean;

@@ -291,3 +285,3 @@ writeContinue(): void;

setHeader(name: string, value: string): void;
sendDate: bool;
sendDate: boolean;
getHeader(name: string): string;

@@ -301,4 +295,4 @@ removeHeader(name: string): void;

// Extended base methods
write(str: string, encoding?: string, fd?: string): bool;
write(buffer: NodeBuffer): bool;
write(str: string, encoding?: string, fd?: string): boolean;
write(buffer: NodeBuffer): boolean;

@@ -310,3 +304,3 @@ write(chunk: any, encoding?: string): void;

setNoDelay(noDelay?: Function): void;
setSocketKeepAlive(enable?: bool, initialDelay?: number): void;
setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
}

@@ -324,3 +318,3 @@ export interface ClientResponse extends events.NodeEventEmitter, stream.ReadableStream {

export var STATUS_CODES;
export var STATUS_CODES: any;
export function createServer(requestListener?: (request: ServerRequest, response: ServerResponse) =>void ): Server;

@@ -334,28 +328,31 @@ export function createClient(port?: number, host?: string): any;

declare module "cluster" {
import child_process = module("child_process");
import child = require("child_process");
import events = require("events");
export interface ClusterSettings {
exec: string;
args: string[];
silent: bool;
exec?: string;
args?: string[];
silent?: boolean;
}
export interface Worker {
export class Worker extends events.EventEmitter {
id: string;
process: child_process;
suicide: bool;
process: child.ChildProcess;
suicide: boolean;
send(message: any, sendHandle?: any): void;
destroy(): void;
kill(signal?: string): void;
destroy(signal?: string): void;
disconnect(): void;
}
export var settings: ClusterSettings;
export var isMaster: bool;
export var isWorker: bool;
export var isMaster: boolean;
export var isWorker: boolean;
export function setupMaster(settings?: ClusterSettings): void;
export function fork(env?: any): Worker;
export function disconnect(callback?: Function): void;
export var workers: any;
export var worker: Worker;
export var workers: Worker[];
// Event emitter
// Event emitter
export function addListener(event: string, listener: Function): void;

@@ -365,10 +362,10 @@ export function on(event: string, listener: Function): any;

export function removeListener(event: string, listener: Function): void;
export function removeAllListener(event: string): void;
export function removeAllListeners(event?: string): void;
export function setMaxListeners(n: number): void;
export function listeners(event: string): { Function; }[];
export function emit(event: string, arg1?: any, arg2?: any): void;
export function listeners(event: string): Function[];
export function emit(event: string, ...args: any[]): boolean;
}
declare module "zlib" {
import stream = module("stream");
import stream = require("stream");
export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; }

@@ -384,17 +381,17 @@

export function createGzip(options: ZlibOptions): Gzip;
export function createGunzip(options: ZlibOptions): Gunzip;
export function createDeflate(options: ZlibOptions): Deflate;
export function createInflate(options: ZlibOptions): Inflate;
export function createDeflateRaw(options: ZlibOptions): DeflateRaw;
export function createInflateRaw(options: ZlibOptions): InflateRaw;
export function createUnzip(options: ZlibOptions): Unzip;
export function createGzip(options?: ZlibOptions): Gzip;
export function createGunzip(options?: ZlibOptions): Gunzip;
export function createDeflate(options?: ZlibOptions): Deflate;
export function createInflate(options?: ZlibOptions): Inflate;
export function createDeflateRaw(options?: ZlibOptions): DeflateRaw;
export function createInflateRaw(options?: ZlibOptions): InflateRaw;
export function createUnzip(options?: ZlibOptions): Unzip;
export function deflate(buf: NodeBuffer, callback: (error: Error, result) =>void ): void;
export function deflateRaw(buf: NodeBuffer, callback: (error: Error, result) =>void ): void;
export function gzip(buf: NodeBuffer, callback: (error: Error, result) =>void ): void;
export function gunzip(buf: NodeBuffer, callback: (error: Error, result) =>void ): void;
export function inflate(buf: NodeBuffer, callback: (error: Error, result) =>void ): void;
export function inflateRaw(buf: NodeBuffer, callback: (error: Error, result) =>void ): void;
export function unzip(buf: NodeBuffer, callback: (error: Error, result) =>void ): void;
export function deflate(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void;
export function deflateRaw(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void;
export function gzip(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void;
export function gunzip(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void;
export function inflate(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void;
export function inflateRaw(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void;
export function unzip(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void;

@@ -452,5 +449,5 @@ // Constants

declare module "https" {
import tls = module("tls");
import events = module("events");
import http = module("http");
import tls = require("tls");
import events = require("events");
import http = require("http");

@@ -465,5 +462,5 @@ export interface ServerOptions {

ciphers?: string;
honorCipherOrder?: bool;
requestCert?: bool;
rejectUnauthorized?: bool;
honorCipherOrder?: boolean;
requestCert?: boolean;
rejectUnauthorized?: boolean;
NPNProtocols?: any;

@@ -488,3 +485,3 @@ SNICallback?: (servername: string) => any;

ciphers?: string;
rejectUnauthorized?: bool;
rejectUnauthorized?: boolean;
}

@@ -517,8 +514,8 @@

}
export var version;
export var version: any;
}
declare module "repl" {
import stream = module("stream");
import events = module("events");
import stream = require("stream");
import events = require("events");

@@ -529,7 +526,7 @@ export interface ReplOptions {

output?: stream.WritableStream;
terminal?: bool;
terminal?: boolean;
eval?: Function;
useColors?: bool;
useGlobal?: bool;
ignoreUndefined?: bool;
useColors?: boolean;
useGlobal?: boolean;
ignoreUndefined?: boolean;
writer?: Function;

@@ -541,8 +538,8 @@ }

declare module "readline" {
import events = module("events");
import stream = module("stream");
import events = require("events");
import stream = require("stream");
export interface ReadLine extends events.NodeEventEmitter {
setPrompt(prompt: string, length: number): void;
prompt(preserveCursor?: bool): void;
prompt(preserveCursor?: boolean): void;
question(query: string, callback: Function): void;

@@ -558,3 +555,3 @@ pause(): void;

completer?: Function;
terminal?: bool;
terminal?: boolean;
}

@@ -578,4 +575,4 @@ export function createInterface(options: ReadLineOptions): ReadLine;

declare module "child_process" {
import events = module("events");
import stream = module("stream");
import events = require("events");
import stream = require("stream");

@@ -597,3 +594,3 @@ export interface ChildProcess extends events.NodeEventEmitter {

env?: any;
detached?: bool;
detached?: boolean;
}): ChildProcess;

@@ -639,6 +636,6 @@ export function exec(command: string, options: {

query: string;
slashes: bool;
slashes: boolean;
}
export function parse(urlStr: string, parseQueryString? , slashesDenoteHost? ): Url;
export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url;
export function format(url: Url): string;

@@ -664,8 +661,8 @@ export function resolve(from: string, to: string): string;

declare module "net" {
import stream = module("stream");
import stream = require("stream");
export interface NodeSocket extends stream.ReadWriteStream {
// Extended base methods
write(str: string, encoding?: string, fd?: string): bool;
write(buffer: NodeBuffer): bool;
write(str: string, encoding?: string, fd?: string): boolean;
write(buffer: NodeBuffer): boolean;

@@ -682,4 +679,4 @@ connect(port: number, host?: string, connectionListener?: Function): void;

setTimeout(timeout: number, callback?: Function): void;
setNoDelay(noDelay?: bool): void;
setKeepAlive(enable?: bool, initialDelay?: number): void;
setNoDelay(noDelay?: boolean): void;
setKeepAlive(enable?: boolean, initialDelay?: number): void;
address(): { port: number; family: string; address: string; };

@@ -693,3 +690,3 @@ remoteAddress: string;

export var Socket: {
new (options?: { fd?: string; type?: string; allowHalfOpen?: bool; }): NodeSocket;
new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): NodeSocket;
};

@@ -707,16 +704,16 @@

export function createServer(connectionListener?: (socket: NodeSocket) =>void ): Server;
export function createServer(options?: { allowHalfOpen?: bool; }, connectionListener?: (socket: NodeSocket) =>void ): Server;
export function connect(options: { allowHalfOpen?: bool; }, connectionListener?: Function): void;
export function connect(port: number, host?: string, connectionListener?: Function): void;
export function connect(path: string, connectionListener?: Function): void;
export function createConnection(options: { allowHalfOpen?: bool; }, connectionListener?: Function): void;
export function createConnection(port: number, host?: string, connectionListener?: Function): void;
export function createConnection(path: string, connectionListener?: Function): void;
export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: NodeSocket) =>void ): Server;
export function connect(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): NodeSocket;
export function connect(port: number, host?: string, connectionListener?: Function): NodeSocket;
export function connect(path: string, connectionListener?: Function): NodeSocket;
export function createConnection(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): NodeSocket;
export function createConnection(port: number, host?: string, connectionListener?: Function): NodeSocket;
export function createConnection(path: string, connectionListener?: Function): NodeSocket;
export function isIP(input: string): number;
export function isIPv4(input: string): bool;
export function isIPv6(input: string): bool;
export function isIPv4(input: string): boolean;
export function isIPv6(input: string): boolean;
}
declare module "dgram" {
import events = module("events");
import events = require("events");

@@ -730,5 +727,5 @@ export function createSocket(type: string, callback?: Function): Socket;

address: { address: string; family: string; port: number; };
setBroadcast(flag: bool): void;
setBroadcast(flag: boolean): void;
setMulticastTTL(ttl: number): void;
setMulticastLoopback(flag: bool): void;
setMulticastLoopback(flag: boolean): void;
addMembership(multicastAddress: string, multicastInterface?: string): void;

@@ -740,12 +737,12 @@ dropMembership(multicastAddress: string, multicastInterface?: string): void;

declare module "fs" {
import stream = module("stream");
import stream = require("stream");
interface Stats {
isFile(): bool;
isDirectory(): bool;
isBlockDevice(): bool;
isCharacterDevice(): bool;
isSymbolicLink(): bool;
isFIFO(): bool;
isSocket(): bool;
isFile(): boolean;
isDirectory(): boolean;
isBlockDevice(): boolean;
isCharacterDevice(): boolean;
isSymbolicLink(): boolean;
isFIFO(): boolean;
isSocket(): boolean;
dev: number;

@@ -766,3 +763,3 @@ ino: number;

interface FSWatcher {
interface FSWatcher extends EventEmitter {
close(): void;

@@ -776,4 +773,8 @@ }

export function renameSync(oldPath: string, newPath: string): void;
export function truncate(fd: string, len: number, callback?: Function): void;
export function truncateSync(fd: string, len: number): void;
export function truncate(path: string, callback?: Function): void;
export function truncate(path: string, len: number, callback?: Function): void;
export function truncateSync(path: string, len?: number): void;
export function ftruncate(fd: string, callback?: Function): void;
export function ftruncate(fd: string, len: number, callback?: Function): void;
export function ftruncateSync(fd: string, len?: number): void;
export function chown(path: string, uid: number, gid: number, callback?: Function): void;

@@ -785,11 +786,17 @@ export function chownSync(path: string, uid: number, gid: number): void;

export function lchownSync(path: string, uid: number, gid: number): void;
export function chmod(path: string, mode: number, callback?: Function): void;
export function chmod(path: string, mode: string, callback?: Function): void;
export function chmodSync(path: string, mode: number): void;
export function chmodSync(path: string, mode: string): void;
export function fchmod(fd: string, mode: number, callback?: Function): void;
export function fchmod(fd: string, mode: string, callback?: Function): void;
export function fchmodSync(fd: string, mode: number): void;
export function fchmodSync(fd: string, mode: string): void;
export function lchmod(path: string, mode: number, callback?: Function): void;
export function lchmod(path: string, mode: string, callback?: Function): void;
export function lchmodSync(path: string, mode: number): void;
export function lchmodSync(path: string, mode: string): void;
export function stat(path: string, callback?: (err: Error, stats: Stats) =>any): Stats;
export function lstat(path: string, callback?: (err: Error, stats: Stats) =>any): Stats;
export function fstat(fd: string, callback?: (err: Error, stats: Stats) =>any): Stats;
export function stat(path: string, callback?: (err: Error, stats: Stats) => any): void;
export function lstat(path: string, callback?: (err: Error, stats: Stats) => any): void;
export function fstat(fd: string, callback?: (err: Error, stats: Stats) => any): void;
export function statSync(path: string): Stats;

@@ -802,6 +809,7 @@ export function lstatSync(path: string): Stats;

export function symlinkSync(srcpath: string, dstpath: string, type?: string): void;
export function readlink(path: string, callback?: (err: Error, linkString: string) =>any): void;
export function realpath(path: string, callback?: (err: Error, resolvedPath: string) =>any): void;
export function realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) =>any): void;
export function realpathSync(path: string, cache?: string): void;
export function readlink(path: string, callback?: (err: Error, linkString: string) => any): void;
export function readlinkSync(path: string): string;
export function realpath(path: string, callback?: (err: Error, resolvedPath: string) => any): void;
export function realpath(path: string, cache: {[path: string]: string}, callback: (err: Error, resolvedPath: string) =>any): void;
export function realpathSync(path: string, cache?: {[path: string]: string}): void;
export function unlink(path: string, callback?: Function): void;

@@ -811,3 +819,6 @@ export function unlinkSync(path: string): void;

export function rmdirSync(path: string): void;
export function mkdir(path: string, mode?: string, callback?: Function): void;
export function mkdir(path: string, callback?: Function): void;
export function mkdir(path: string, mode: number, callback?: Function): void;
export function mkdir(path: string, mode: string, callback?: Function): void;
export function mkdirSync(path: string, mode?: number): void;
export function mkdirSync(path: string, mode?: string): void;

@@ -818,3 +829,6 @@ export function readdir(path: string, callback?: (err: Error, files: string[]) => void): void;

export function closeSync(fd: string): void;
export function open(path: string, flags: string, mode?: string, callback?: (err: Error, fd: string) =>any): void;
export function open(path: string, flags: string, callback?: (err: Error, fd: string) => any): void;
export function open(path: string, flags: string, mode: number, callback?: (err: Error, fd: string) => any): void;
export function open(path: string, flags: string, mode: string, callback?: (err: Error, fd: string) => any): void;
export function openSync(path: string, flags: string, mode?: number): void;
export function openSync(path: string, flags: string, mode?: string): void;

@@ -827,22 +841,26 @@ export function utimes(path: string, atime: number, mtime: number, callback?: Function): void;

export function fsyncSync(fd: string): void;
export function write(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err, written: number, buffer: NodeBuffer) =>any): void;
export function write(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) =>any): void;
export function writeSync(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number): void;
export function read(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err, bytesRead: number, buffer: NodeBuffer) => void): void;
export function read(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void;
export function readSync(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number): any[];
export function readFile(filename: string, options: { encoding?: string; flag?: string; }, callback: (err, data: any) => void ): void;
export function readFile(filename: string, callback: (err, data: NodeBuffer) => void ): void;
export function readFile(filename: string, options: { encoding?: string; flag?: string; }, callback: (err: Error, data: any) => void): void;
export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void;
export function readFileSync(filename: string): NodeBuffer;
export function readFileSync(filename: string, options: { encoding?: string; flag?: string; }): any;
export function writeFile(filename: string, data: any, callback?: (err) => void): void;
export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err) => void): void;
export function writeFile(filename: string, data: any, callback?: (err: Error) => void): void;
export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: Error) => void): void;
export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: Error) => void): void;
export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err) => void): void;
export function appendFile(filename: string, data: any, callback?: (err) => void): void;
export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: Error) => void): void;
export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: Error) => void): void;
export function appendFile(filename: string, data: any, callback?: (err: Error) => void): void;
export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
export function watchFile(filename: string, listener: { curr: Stats; prev: Stats; }): void;
export function watchFile(filename: string, options: { persistent?: bool; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void;
export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void;
export function unwatchFile(filename: string, listener?: Stats): void;
export function watch(filename: string, options?: { persistent?: bool; }, listener?: (event: string, filename: string) =>any): FSWatcher;
export function exists(path: string, callback?: (exists: bool) =>void ): void;
export function existsSync(path: string): bool;
export function watch(filename: string, options?: { persistent?: boolean; }, listener?: (event: string, filename: string) =>any): FSWatcher;
export function exists(path: string, callback?: (exists: boolean) => void): void;
export function existsSync(path: string): boolean;
export function createReadStream(path: string, options?: {

@@ -855,2 +873,9 @@ flags?: string;

}): ReadStream;
export function createReadStream(path: string, options?: {
flags?: string;
encoding?: string;
fd?: string;
mode?: string;
bufferSize?: number;
}): ReadStream;
export function createWriteStream(path: string, options?: {

@@ -866,7 +891,3 @@ flags?: string;

export function join(...paths: any[]): string;
export function resolve(from: string, to: string): string;
export function resolve(from: string, from2: string, to: string): string;
export function resolve(from: string, from2: string, from3: string, to: string): string;
export function resolve(from: string, from2: string, from3: string, from4: string, to: string): string;
export function resolve(from: string, from2: string, from3: string, from4: string, from5: string, to: string): string;
export function resolve(...pathSegments: any[]): string;
export function relative(from: string, to: string): string;

@@ -890,5 +911,5 @@ export function dirname(p: string): string;

declare module "tls" {
import crypto = module("crypto");
import net = module("net");
import stream = module("stream");
import crypto = require("crypto");
import net = require("net");
import stream = require("stream");

@@ -907,4 +928,4 @@ var CLIENT_RENEG_LIMIT: number;

honorCipherOrder?: any;
requestCert?: bool;
rejectUnauthorized?: bool;
requestCert?: boolean;
rejectUnauthorized?: boolean;
NPNProtocols?: any; //array or Buffer;

@@ -923,3 +944,3 @@ SNICallback?: (servername: string) => any;

ca?: any; //Array of string | Buffer
rejectUnauthorized?: bool;
rejectUnauthorized?: boolean;
NPNProtocols?: any; //Array of string | Buffer

@@ -948,3 +969,3 @@ servername?: string;

export interface ClearTextStream extends stream.ReadWriteStream {
authorized: bool;
authorized: boolean;
authorizationError: Error;

@@ -974,3 +995,3 @@ getPeerCertificate(): any;

export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream;
export function createSecurePair(credentials?: crypto.Credentials, isServer?: bool, requestCert?: bool, rejectUnauthorized?: bool): SecurePair;
export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
}

@@ -993,3 +1014,3 @@

interface Hash {
update(data: any, input_encoding?: string): void;
update(data: any, input_encoding?: string): Hash;
digest(encoding?: string): string;

@@ -1006,3 +1027,3 @@ }

final(output_encoding?: string): string;
setAutoPadding(auto_padding: bool): void;
setAutoPadding(auto_padding: boolean): void;
createDecipher(algorithm: string, password: any): Decipher;

@@ -1014,3 +1035,3 @@ createDecipheriv(algorithm: string, key: any, iv: any): Decipher;

final(output_encoding?: string): string;
setAutoPadding(auto_padding: bool): void;
setAutoPadding(auto_padding: boolean): void;
}

@@ -1025,3 +1046,3 @@ export function createSign(algorithm: string): Signer;

update(data: any): void;
verify(object: string, signature: string, signature_format?: string): bool;
verify(object: string, signature: string, signature_format?: string): boolean;
}

@@ -1042,12 +1063,12 @@ export function createDiffieHellman(prime_length: number): DiffieHellman;

export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: string) => any): void;
export function randomBytes(size: number, callback?: (err: Error, buf: NodeBuffer) =>void );
export function randomBytes(size: number, callback?: (err: Error, buf: NodeBuffer) =>void ): void;
}
declare module "stream" {
import events = module("events");
import events = require("events");
export interface WritableStream extends events.NodeEventEmitter {
writable: bool;
write(str: string, encoding?: string, fd?: string): bool;
write(buffer: NodeBuffer): bool;
writable: boolean;
write(str: string, encoding?: string, fd?: string): boolean;
write(buffer: NodeBuffer): boolean;
end(): void;

@@ -1061,3 +1082,3 @@ end(str: string, enconding: string): void;

export interface ReadableStream extends events.NodeEventEmitter {
readable: bool;
readable: boolean;
setEncoding(encoding: string): void;

@@ -1067,5 +1088,23 @@ pause(): void;

destroy(): void;
pipe(destination: WritableStream, options?: { end?: bool; }): void;
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T;
}
export interface ReadableOptions {
highWaterMark?: number;
encoding?: string;
objectMode?: boolean;
}
export class Readable extends events.EventEmitter implements ReadableStream {
readable: boolean;
constructor(opts?: ReadableOptions);
setEncoding(encoding: string): void;
pause(): void;
resume(): void;
destroy(): void;
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T;
_read(): void;
push(chunk: any, encoding?: string): boolean;
}
export interface ReadWriteStream extends ReadableStream, WritableStream { }

@@ -1081,7 +1120,7 @@ }

export function log(string: string): void;
export function inspect(object: any, showHidden?: bool, depth?: number, color?: bool): void;
export function isArray(object: any): bool;
export function isRegExp(object: any): bool;
export function isDate(object: any): bool;
export function isError(object: any): bool;
export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string;
export function isArray(object: any): boolean;
export function isRegExp(object: any): boolean;
export function isDate(object: any): boolean;
export function isError(object: any): boolean;
export function inherits(constructor: any, superConstructor: any): void;

@@ -1091,24 +1130,28 @@ }

declare module "assert" {
export function (booleanValue: bool, message?: string);
export function fail(actual: any, expected: any, message: string, operator: string): void;
export function assert(value: any, message: string): void;
export function ok(value: any, message?: string): void;
export function equal(actual: any, expected: any, message?: string): void;
export function notEqual(actual: any, expected: any, message?: string): void;
export function deepEqual(actual: any, expected: any, message?: string): void;
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
export function strictEqual(actual: any, expected: any, message?: string): void;
export function notStrictEqual(actual: any, expected: any, message?: string): void;
export function throws(block: any, error?: any, messsage?: string): void;
export function doesNotThrow(block: any, error?: any, messsage?: string): void;
export function ifError(value: any): void;
function internal (booleanValue: boolean, message?: string): void;
module internal {
export function fail(actual: any, expected: any, message: string, operator: string): void;
export function assert(value: any, message: string): void;
export function ok(value: any, message?: string): void;
export function equal(actual: any, expected: any, message?: string): void;
export function notEqual(actual: any, expected: any, message?: string): void;
export function deepEqual(actual: any, expected: any, message?: string): void;
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
export function strictEqual(actual: any, expected: any, message?: string): void;
export function notStrictEqual(actual: any, expected: any, message?: string): void;
export function throws(block: any, error?: any, messsage?: string): void;
export function doesNotThrow(block: any, error?: any, messsage?: string): void;
export function ifError(value: any): void;
}
export = internal;
}
declare module "tty" {
import net = module("net");
import net = require("net");
export function isatty(fd: string): bool;
export function isatty(fd: string): boolean;
export interface ReadStream extends net.NodeSocket {
isRaw: bool;
setRawMode(mode: bool): void;
isRaw: boolean;
setRawMode(mode: boolean): void;
}

@@ -1122,3 +1165,3 @@ export interface WriteStream extends net.NodeSocket {

declare module "domain" {
import events = module("events");
import events = require("events");

@@ -1125,0 +1168,0 @@ export interface Domain extends events.NodeEventEmitter { }

var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }

@@ -6,9 +7,13 @@ __.prototype = b.prototype;

};
/// <reference path='../defs/node.d.ts'/>
"use strict";
var http = require('http')
var querystring = require('querystring')
var http = require('http');
var querystring = require('querystring');
var ApiHost = (function () {
function ApiHost(hc, path) {
if(hc) {
if(typeof (hc) === "object") {
if (hc) {
if (typeof (hc) === "object") {
this.host = hc.host;

@@ -27,2 +32,3 @@ this.path = hc.path;

})();
var Episode = (function () {

@@ -37,8 +43,8 @@ function Episode(season, name, number) {

exports.Episode = Episode;
var Movie = (function () {
function Movie(obj) {
for(var attr in obj) {
if(obj.hasOwnProperty(attr)) {
for (var attr in obj) {
if (obj.hasOwnProperty(attr))
this[attr] = obj[attr];
}
}

@@ -49,2 +55,3 @@ }

exports.Movie = Movie;
var TVShow = (function (_super) {

@@ -57,34 +64,42 @@ __extends(TVShow, _super);

TVShow.prototype.episodes = function (cb) {
if(typeof (cb) !== "function") {
if (typeof (cb) !== "function")
throw new TypeError("cb must be a function");
}
if(this._episodes.length !== 0) {
if (this._episodes.length !== 0) {
return this._episodes;
}
var tvShow = this;
var episodeList = "";
var myPoromenos;
myPoromenos = new ApiHost(poromenos);
myPoromenos.path += "?" + querystring.stringify({
name: tvShow.title
});
myPoromenos.path += "?" + querystring.stringify({ name: tvShow.title });
return http.get(myPoromenos, onResponse).on('error', onError);
function onResponse(res) {
return res.on('data', onData).on('error', onError).on('end', onEnd);
}
function onData(data) {
return (episodeList += data.toString('utf8'));
}
function onEnd() {
var eps = episodeList;
if(eps === "") {
if (eps === "" || eps === "null")
return cb(new Error("could not get episodes"), null);
}
var episodes = [];
eps = JSON.parse(eps)[tvShow.title].episodes;
for(var i = 0; i < eps.length; i++) {
for (var i = 0; i < eps.length; i++) {
episodes[i] = new Episode(eps[i].season, eps[i].name, eps[i].number);
}
return cb(null, episodes);
}
function onError(err) {

@@ -97,2 +112,3 @@ return cb(err, null);

exports.TVShow = TVShow;
var ImdbError = (function () {

@@ -107,30 +123,35 @@ function ImdbError(message, movie) {

exports.ImdbError = ImdbError;
var deanclatworthy = new ApiHost("deanclatworthy.com", "/imdb/");
var poromenos = new ApiHost("imdbapi.poromenos.org", "/js/");
function getReq(req, cb) {
var responseData = "";
if(typeof (cb) !== "function") {
if (typeof (cb) !== "function")
throw new TypeError("cb must be a function");
}
var myDeanclatworthy;
myDeanclatworthy = new ApiHost(deanclatworthy);
if(req.name) {
myDeanclatworthy.path += "?" + querystring.stringify({
q: req.name,
yg: 0
});
} else if(req.id) {
myDeanclatworthy.path += "?" + querystring.stringify({
id: req.id
});
if (req.name) {
myDeanclatworthy.path += "?" + querystring.stringify({ q: req.name, yg: 0 });
} else if (req.id) {
myDeanclatworthy.path += "?" + querystring.stringify({ id: req.id });
}
return http.get(myDeanclatworthy, onResponse).on('error', onError);
function onResponse(res) {
return res.on('data', onData).on('error', onError).on('end', onEnd);
}
function onData(data) {
responseData += data;
}
function onEnd() {
var responseObject;
try {

@@ -141,12 +162,15 @@ responseObject = JSON.parse(responseData);

}
if(responseObject.hasOwnProperty("code") && responseObject.hasOwnProperty("error")) {
if (responseObject.hasOwnProperty("code") && responseObject.hasOwnProperty("error")) {
return cb(new ImdbError(responseObject.error + ": " + (req.name ? req.name : req.id), req), null);
}
if(responseObject.series === 0) {
if (responseObject.series === 0)
responseObject = new Movie(responseObject);
} else {
else
responseObject = new TVShow(responseObject);
}
return cb(null, responseObject);
}
function onError(err) {

@@ -157,25 +181,25 @@ return cb(err, null);

exports.getReq = getReq;
function get(name, cb) {
return getReq({
id: undefined,
name: name
}, cb);
return exports.getReq({ id: undefined, name: name }, cb);
}
exports.get = get;
;
function getById(id, cb) {
var intRegex = /^\d+$/;
if(intRegex.test(id)) {
if (intRegex.test(id)) {
// user give us a raw id we need to prepend it with tt
id = 'tt' + id;
}
var imdbRegex = /^tt\d+$/;
if(!imdbRegex.test(id)) {
if (!imdbRegex.test(id)) {
throw new TypeError("id must be a an imdb id (tt12345 or 12345)");
}
return getReq({
id: id,
name: undefined
}, cb);
return exports.getReq({ id: id, name: undefined }, cb);
}
exports.getById = getById;
;

@@ -5,3 +5,3 @@ {

"description": "Queries unofficial imdb APIs to get movie and television information from imdb",
"version": "1.3.1",
"version": "1.3.2",
"main": "lib/imdb.js",

@@ -8,0 +8,0 @@ "homepage": "https://github.com/worr/node-imdb-api",

@@ -0,6 +1,7 @@

/// <reference path='../defs/node.d.ts'/>
"use strict";
///<reference path='../defs/node.d.ts'/>
import http = module('http');
import querystring = module('querystring');
import events = require('events');
import http = require('http');
import querystring = require('querystring');

@@ -46,9 +47,9 @@ export interface MovieRequest {

public votes: string;
public stv: bool;
public series: bool;
public stv: boolean;
public series: boolean;
public rating: string;
public runtime: string;
public title: string;
public usascreens: bool;
public ukscreens: bool;
public usascreens: boolean;
public ukscreens: boolean;

@@ -99,3 +100,3 @@ constructor (obj: Object) {

if (eps === "")
if (eps === "" || eps === "null")
return cb(new Error("could not get episodes"), null);

@@ -102,0 +103,0 @@

Sorry, the diff of this file is not supported yet

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