Socket
Socket
Sign inDemoInstall

@types/shelljs

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/shelljs - npm Package Compare versions

Comparing version 0.7.5 to 0.7.6

232

shelljs/index.d.ts

@@ -22,3 +22,3 @@ // Type definitions for ShellJS 0.7

*/
export function pwd(): string;
export function pwd(): ShellString;

@@ -30,3 +30,3 @@ /**

*/
export function ls(...paths: string[]): string[];
export function ls(...paths: Array<string | string[]>): ShellArray;

@@ -39,20 +39,5 @@ /**

*/
export function ls(options: string, ...paths: string[]): string[];
export function ls(options: string, ...paths: Array<string | string[]>): ShellArray;
/**
* Returns array of files in the given path, or in current directory if no path provided.
* @param paths Paths to search.
* @return An array of files in the given path(s).
*/
export function ls(paths: string[]): string[];
/**
* Returns array of files in the given path, or in current directory if no path provided.
* @param options Available options: -R (recursive), -A (all files, include files beginning with ., except for . and ..)
* @param paths Paths to search.
* @return An array of files in the given path(s).
*/
export function ls(options: string, paths: string[]): string[];
/**
* Returns array of all files (however deep) in the given paths.

@@ -62,12 +47,5 @@ * @param ...path The path(s) to search.

*/
export function find(...path: string[]): string[];
export function find(...path: Array<string | string[]>): ShellArray;
/**
* Returns array of all files (however deep) in the given paths.
* @param path The path(s) to search.
* @return An array of all files (however deep) in the given path(s).
*/
export function find(path: string[]): string[];
/**
* Copies files. The wildcard * is accepted.

@@ -77,13 +55,6 @@ * @param source The source.

*/
export function cp(source: string, dest: string): void;
export function cp(source: string | string[], dest: string): void;
/**
* Copies files. The wildcard * is accepted.
* @param source The source.
* @param dest The destination.
*/
export function cp(source: string[], dest: string): void;
/**
* Copies files. The wildcard * is accepted.
* @param options Available options: -f (force), -r, -R (recursive)

@@ -93,39 +64,18 @@ * @param source The source.

*/
export function cp(options: string, source: string, dest: string): void;
export function cp(options: string, source: string | string[], dest: string): void;
/**
* Copies files. The wildcard * is accepted.
* @param options Available options: -f (force), -r, -R (recursive)
* @param source The source.
* @param dest The destination.
*/
export function cp(options: string, source: string[], dest: string): void;
/**
* Removes files. The wildcard * is accepted.
* @param ...files Files to remove.
*/
export function rm(...files: string[]): void;
export function rm(...files: Array<string | string[]>): void;
/**
* Removes files. The wildcard * is accepted.
* @param files Files to remove.
*/
export function rm(files: string[]): void;
/**
* Removes files. The wildcard * is accepted.
* @param options Available options: -f (force), -r, -R (recursive)
* @param ...files Files to remove.
*/
export function rm(options: string, ...files: string[]): void;
export function rm(options: string, ...files: Array<string | string[]>): void;
/**
* Removes files. The wildcard * is accepted.
* @param options Available options: -f (force), -r, -R (recursive)
* @param ...files Files to remove.
*/
export function rm(options: string, files: string[]): void;
/**
* Moves files. The wildcard * is accepted.

@@ -135,38 +85,18 @@ * @param source The source.

*/
export function mv(source: string, dest: string): void;
export function mv(source: string | string[], dest: string): void;
/**
* Moves files. The wildcard * is accepted.
* @param source The source.
* @param dest The destination.
*/
export function mv(source: string[], dest: string): void;
/**
* Creates directories.
* @param ...dir Directories to create.
*/
export function mkdir(...dir: string[]): void;
export function mkdir(...dir: Array<string | string[]>): void;
/**
* Creates directories.
* @param dir Directories to create.
*/
export function mkdir(dir: string[]): void;
/**
* Creates directories.
* @param options Available options: p (full paths, will create intermediate dirs if necessary)
* @param ...dir The directories to create.
*/
export function mkdir(options: string, ...dir: string[]): void;
export function mkdir(options: string, ...dir: Array<string | string[]>): void;
/**
* Creates directories.
* @param options Available options: p (full paths, will create intermediate dirs if necessary)
* @param dir The directories to create.
*/
export function mkdir(options: string, dir: string[]): void;
/**
* Evaluates expression using the available primaries and returns corresponding value.

@@ -184,27 +114,5 @@ * @param option '-b': true if path is a block device; '-c': true if path is a character device; '-d': true if path is a directory; '-e': true if path exists; '-f': true if path is a regular file; '-L': true if path is a symboilc link; '-p': true if path is a pipe (FIFO); '-S': true if path is a socket

*/
export function cat(...files: string[]): string;
export function cat(...files: Array<string | string[]>): ShellString;
/**
* Returns a string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file). Wildcard * accepted.
* @param files Files to use.
* @return A string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file).
*/
export function cat(files: string[]): string;
// Does not work yet.
export interface String {
/**
* Analogous to the redirection operator > in Unix, but works with JavaScript strings (such as those returned by cat, grep, etc). Like Unix redirections, to() will overwrite any existing file!
* @param file The file to use.
*/
to(file: string): void;
/**
* Analogous to the redirect-and-append operator >> in Unix, but works with JavaScript strings (such as those returned by cat, grep, etc).
* @param file The file to append to.
*/
toEnd(file: string): void;
}
/**
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.

@@ -216,15 +124,6 @@ * @param searchRegex The regular expression to use for search.

*/
export function sed(searchRegex: RegExp, replacement: string, file: string): string;
export function sed(searchRegex: string | RegExp, replacement: string, file: string): ShellString;
/**
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
* @param searchRegex The regular expression to use for search.
* @param replacement The replacement.
* @param file The file to process.
* @return The new string after replacement.
*/
export function sed(searchRegex: string, replacement: string, file: string): string;
/**
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
* @param options Available options: -i (Replace contents of 'file' in-place. Note that no backups will be created!)

@@ -236,15 +135,5 @@ * @param searchRegex The regular expression to use for search.

*/
export function sed(options: string, searchRegex: RegExp, replacement: string, file: string): string;
export function sed(options: string, searchRegex: string | RegExp, replacement: string, file: string): ShellString;
/**
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
* @param options Available options: -i (Replace contents of 'file' in-place. Note that no backups will be created!)
* @param searchRegex The regular expression to use for search.
* @param replacement The replacement.
* @param file The file to process.
* @return The new string after replacement.
*/
export function sed(options: string, searchRegex: string, replacement: string, file: string): string;
/**
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.

@@ -255,14 +144,6 @@ * @param regex_filter The regular expression to use.

*/
export function grep(regex_filter: RegExp, ...files: string[]): string;
export function grep(regex_filter: string | RegExp, ...files: Array<string | string[]>): ShellString;
/**
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
* @param regex_filter The regular expression to use.
* @param ...files The files to process.
* @return Returns a string containing all lines of the file that match the given regex_filter.
*/
export function grep(regex_filter: RegExp, files: string[]): string;
/**
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
* @param options Available options: -v (Inverse the sense of the regex and print the lines not matching the criteria.)

@@ -273,14 +154,5 @@ * @param regex_filter The regular expression to use.

*/
export function grep(options: string, regex_filter: string, ...files: string[]): string;
export function grep(options: string, regex_filter: string | RegExp, ...files: Array<string | string[]>): ShellString;
/**
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
* @param options Available options: -v (Inverse the sense of the regex and print the lines not matching the criteria.)
* @param regex_filter The regular expression to use.
* @param files The files to process.
* @return Returns a string containing all lines of the file that match the given regex_filter.
*/
export function grep(options: string, regex_filter: string, files: string[]): string;
/**
* Searches for command in the system's PATH. On Windows looks for .exe, .cmd, and .bat extensions.

@@ -290,3 +162,3 @@ * @param command The command to search for.

*/
export function which(command: string): string;
export function which(command: string): ShellString;

@@ -298,3 +170,3 @@ /**

*/
export function echo(...text: string[]): string;
export function echo(...text: string[]): ShellString;

@@ -306,3 +178,3 @@ /**

*/
export function pushd(dir: "+N"): string[];
export function pushd(dir: "+N"): ShellArray;

@@ -314,3 +186,3 @@ /**

*/
export function pushd(dir: "-N"): string[];
export function pushd(dir: "-N"): ShellArray;

@@ -322,3 +194,3 @@ /**

*/
export function pushd(dir: string): string[];
export function pushd(dir: string): ShellArray;

@@ -331,3 +203,3 @@ /**

*/
export function pushd(options: string, dir: "+N"): string[];
export function pushd(options: string, dir: "+N"): ShellArray;

@@ -340,3 +212,3 @@ /**

*/
export function pushd(options: string, dir: "-N"): string[];
export function pushd(options: string, dir: "-N"): ShellArray;

@@ -349,3 +221,3 @@ /**

*/
export function pushd(options: string, dir: string): string[];
export function pushd(options: string, dir: string): ShellArray;

@@ -357,3 +229,3 @@ /**

*/
export function popd(dir: "+N"): string[];
export function popd(dir: "+N"): ShellArray;

@@ -364,3 +236,3 @@ /**

*/
export function popd(): string[];
export function popd(): ShellArray;

@@ -372,3 +244,3 @@ /**

*/
export function popd(dir: "-N"): string[];
export function popd(dir: "-N"): ShellArray;

@@ -380,3 +252,3 @@ /**

*/
export function popd(dir: string): string[];
export function popd(dir: string): ShellArray;

@@ -389,3 +261,3 @@ /**

*/
export function popd(options: string, dir: "+N"): string[];
export function popd(options: string, dir: "+N"): ShellArray;

@@ -398,3 +270,3 @@ /**

*/
export function popd(options: string, dir: "-N"): string[];
export function popd(options: string, dir: "-N"): ShellArray;

@@ -407,3 +279,3 @@ /**

*/
export function popd(options: string, dir: string): string[];
export function popd(options: string, dir: string): ShellArray;

@@ -415,3 +287,3 @@ /**

*/
export function dirs(options: "-c"): string[];
export function dirs(options: "-c"): ShellArray;

@@ -423,3 +295,3 @@ /**

*/
export function dirs(options: "+N"): string;
export function dirs(options: "+N"): ShellString;

@@ -431,3 +303,3 @@ /**

*/
export function dirs(options: "-N"): string;
export function dirs(options: "-N"): ShellString;

@@ -507,2 +379,26 @@ /**

export interface ShellReturnValue extends ExecOutputReturnValue {
/**
* Analogous to the redirection operator > in Unix, but works with JavaScript strings (such as those returned by cat, grep, etc). Like Unix redirections, to() will overwrite any existing file!
* @param file The file to use.
*/
to(file: string): void;
/**
* Analogous to the redirect-and-append operator >> in Unix, but works with JavaScript strings (such as those returned by cat, grep, etc).
* @param file The file to append to.
*/
toEnd(file: string): void;
cat(...files: string[]): ShellString;
exec(callback: ExecCallback): child.ChildProcess;
exec(): ExecOutputReturnValue;
grep(...files: Array<string | string[]>): ShellString;
sed(replacement: string, file: string): ShellString;
}
export type ShellString = string & ShellReturnValue;
export type ShellArray = string[] & ShellReturnValue;
/**

@@ -532,3 +428,3 @@ * Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:

*/
export function tempdir(): string;
export function tempdir(): ShellString;

@@ -539,3 +435,3 @@ /**

*/
export function error(): string;
export function error(): ShellString;

@@ -547,3 +443,3 @@ export type TouchOptionsLiteral = "-a" | "-c" | "-m" | "-d" | "-r";

*/
export interface touchOptionsArray {
export interface TouchOptionsArray {
'-d'?: string;

@@ -555,6 +451,4 @@ '-r'?: string;

export function touch(files: string[]): void;
export function touch(options: TouchOptionsLiteral, ...files: string[]): void;
export function touch(options: TouchOptionsLiteral, files: string[]): void;
export function touch(options: touchOptionsArray, ...files: string[]): void;
export function touch(options: touchOptionsArray, files: string[]): void;
export function touch(options: TouchOptionsLiteral, ...files: Array<string | string[]>): void;
export function touch(options: TouchOptionsArray, ...files: Array<string | string[]>): void;

@@ -561,0 +455,0 @@ // Configuration

{
"name": "@types/shelljs",
"version": "0.7.5",
"version": "0.7.6",
"description": "TypeScript definitions for ShellJS",

@@ -28,4 +28,4 @@ "license": "MIT",

},
"typesPublisherContentHash": "a4d55e8f598a8106a4487edbd2ee9f2fd52546064f0d7d6a1c60e7954c2397e8",
"typesPublisherContentHash": "e352f7f7baca83305b4518f14f4064e16a4d8eeb79a1e14f7d178f79ee2be689",
"typeScriptVersion": "2.0"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Wed, 25 Oct 2017 16:18:58 GMT
* Last updated: Mon, 13 Nov 2017 01:14:57 GMT
* Dependencies: child_process, glob, node

@@ -14,0 +14,0 @@ * Global values: none

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