fp-ts-node
Advanced tools
Comparing version 4.4.0 to 5.0.0
@@ -10,8 +10,7 @@ /// <reference types="node" /> | ||
* @category Constructors | ||
* @since 2.1.0 | ||
*/ close, } from "./fs/file-descriptor"; | ||
*/ | ||
close, } from "./fs/file-descriptor"; | ||
export { | ||
/** | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -22,3 +21,2 @@ access, | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
@@ -28,3 +26,2 @@ copyFile, | ||
* @category Constructors | ||
* @since 2.2.0 | ||
*/ | ||
@@ -35,3 +32,2 @@ mkdir, } from "./fs/path"; | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -41,3 +37,2 @@ appendFile, | ||
* @category Constructors | ||
* @since 2.3.0 | ||
*/ | ||
@@ -51,3 +46,2 @@ readFile, } from "./fs/_internal"; | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -60,4 +54,3 @@ export declare function chmod(mode: fs.Mode): ReaderTaskNodeEither<fs.PathLike, void>; | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
export declare function chown(uid: number, gid: number): ReaderTaskNodeEither<fs.PathLike, void>; |
@@ -24,3 +24,2 @@ "use strict"; | ||
/** | ||
* @since 2.0.0 | ||
*/ | ||
@@ -35,8 +34,7 @@ var fp_ts_1 = require("fp-ts"); | ||
* @category Constructors | ||
* @since 2.1.0 | ||
*/ Object.defineProperty(exports, "close", { enumerable: true, get: function () { return file_descriptor_1.close; } }); | ||
*/ | ||
Object.defineProperty(exports, "close", { enumerable: true, get: function () { return file_descriptor_1.close; } }); | ||
var path_1 = require("./fs/path"); | ||
/** | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -47,3 +45,2 @@ Object.defineProperty(exports, "access", { enumerable: true, get: function () { return path_1.access; } }); | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
@@ -53,3 +50,2 @@ Object.defineProperty(exports, "copyFile", { enumerable: true, get: function () { return path_1.copyFile; } }); | ||
* @category Constructors | ||
* @since 2.2.0 | ||
*/ | ||
@@ -60,3 +56,2 @@ Object.defineProperty(exports, "mkdir", { enumerable: true, get: function () { return path_1.mkdir; } }); | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -66,3 +61,2 @@ Object.defineProperty(exports, "appendFile", { enumerable: true, get: function () { return _internal_1.appendFile; } }); | ||
* @category Constructors | ||
* @since 2.3.0 | ||
*/ | ||
@@ -76,3 +70,2 @@ Object.defineProperty(exports, "readFile", { enumerable: true, get: function () { return _internal_1.readFile; } }); | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -90,3 +83,2 @@ function chmod(mode) { | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -93,0 +85,0 @@ function chown(uid, gid) { |
@@ -27,3 +27,6 @@ /// <reference types="node" /> | ||
flag?: string; | ||
}): ReaderTaskNodeEither<PathLikeOrFD, Buffer>; | ||
export declare function readFile(options?: { | ||
flag?: string; | ||
encoding: BufferEncoding; | ||
}): ReaderTaskNodeEither<PathLikeOrFD, string>; |
@@ -46,15 +46,7 @@ "use strict"; | ||
exports.appendFile = appendFile; | ||
/** | ||
* Asynchronously reads the entire contents of a file. | ||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol. | ||
* URL support is _experimental_. | ||
* If a file descriptor is provided, the underlying file will _not_ be closed automatically. | ||
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. | ||
* If a flag is not provided, it defaults to `'r'`. | ||
*/ | ||
function readFile(options) { | ||
return function (path) { | ||
return fp_ts_1.taskEither.taskify(fs.readFile)(path, options || { encoding: "utf8" }); | ||
return fp_ts_1.taskEither.taskify(fs.readFile)(path, options); | ||
}; | ||
} | ||
exports.readFile = readFile; |
/// <reference types="node" /> | ||
/** | ||
* @since 4.3.0 | ||
*/ | ||
import { WriteFileOptions } from "fs"; | ||
@@ -9,3 +6,2 @@ import { FileDescriptor, ReaderTaskNodeEither } from "./types"; | ||
* @category Constructors | ||
* @since 4.2.0 | ||
*/ | ||
@@ -18,12 +14,10 @@ export declare const appendFile: (options?: WriteFileOptions) => (data: string | Uint8Array) => ReaderTaskNodeEither<FileDescriptor, void>; | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
export declare const close: ReaderTaskNodeEither<FileDescriptor, void>; | ||
/** | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
export declare const readFile: (options?: { | ||
flag?: string | undefined; | ||
export declare function readFile(options?: { | ||
flag?: string; | ||
}): ReaderTaskNodeEither<FileDescriptor, Buffer>; | ||
export declare function readFile(options?: { | ||
flag?: string; | ||
encoding: BufferEncoding; | ||
}) => ReaderTaskNodeEither<FileDescriptor, string>; | ||
}): ReaderTaskNodeEither<FileDescriptor, string>; |
@@ -23,8 +23,9 @@ "use strict"; | ||
exports.readFile = exports.close = exports.appendFile = void 0; | ||
/** | ||
*/ | ||
var fp_ts_1 = require("fp-ts"); | ||
var fs = __importStar(require("fs")); | ||
var internal = __importStar(require("./_internal")); | ||
var fp_ts_1 = require("fp-ts"); | ||
/** | ||
* @category Constructors | ||
* @since 4.2.0 | ||
*/ | ||
@@ -37,3 +38,2 @@ exports.appendFile = internal.appendFile; | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
@@ -43,4 +43,6 @@ exports.close = fp_ts_1.taskEither.taskify(fs.close); | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
exports.readFile = internal.readFile; | ||
function readFile(options) { | ||
return internal.readFile(options); | ||
} | ||
exports.readFile = readFile; |
/// <reference types="node" /> | ||
/** | ||
* @since 4.3.0 | ||
*/ | ||
@@ -17,10 +16,9 @@ import { option as O } from "fp-ts"; | ||
export declare function access(mode?: number): ReaderTaskNodeEither<fs.PathLike, void>; | ||
/** | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
export declare const readFile: (options?: { | ||
flag?: string | undefined; | ||
export declare function readFile(options?: { | ||
flag?: string; | ||
}): ReaderTaskNodeEither<fs.PathLike, Buffer>; | ||
export declare function readFile(options?: { | ||
flag?: string; | ||
encoding: BufferEncoding; | ||
}) => ReaderTaskNodeEither<fs.PathLike, string>; | ||
}): ReaderTaskNodeEither<fs.PathLike, string>; | ||
/** | ||
@@ -39,3 +37,2 @@ * Asynchronously append data to a file, creating the file if it does not exist. | ||
* @category Constructors | ||
* @since 4.0.0 | ||
*/ | ||
@@ -57,3 +54,2 @@ export declare const appendFile: (options?: fs.WriteFileOptions) => (data: string | Uint8Array) => ReaderTaskNodeEither<fs.PathLike, void>; | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
@@ -77,4 +73,3 @@ export declare function copyFile(options: ({ | ||
* @category Constructors | ||
* @since 3.2.0 | ||
*/ | ||
export declare function mkdir(options?: fs.Mode | fs.MakeDirectoryOptions): ReaderTaskNodeEither<fs.PathLike, O.Option<string>>; |
@@ -24,3 +24,2 @@ "use strict"; | ||
/** | ||
* @since 4.3.0 | ||
*/ | ||
@@ -47,5 +46,7 @@ var fp_ts_1 = require("fp-ts"); | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
exports.readFile = internal.readFile; | ||
function readFile(options) { | ||
return internal.readFile(options); | ||
} | ||
exports.readFile = readFile; | ||
/** | ||
@@ -64,3 +65,2 @@ * Asynchronously append data to a file, creating the file if it does not exist. | ||
* @category Constructors | ||
* @since 4.0.0 | ||
*/ | ||
@@ -82,3 +82,2 @@ exports.appendFile = internal.appendFile; | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
@@ -101,3 +100,2 @@ function copyFile(options) { | ||
* @category Constructors | ||
* @since 3.2.0 | ||
*/ | ||
@@ -104,0 +102,0 @@ function mkdir(options) { |
@@ -9,3 +9,2 @@ /// <reference types="node" /> | ||
* @category Model | ||
* @since 3.1.0 | ||
*/ | ||
@@ -12,0 +11,0 @@ export interface ReaderTaskNodeEither<R, A> extends readerTaskEither.ReaderTaskEither<R, NodeJS.ErrnoException, A> { |
@@ -10,8 +10,7 @@ /// <reference types="node" /> | ||
* @category Constructors | ||
* @since 2.1.0 | ||
*/ close, } from "./fs/file-descriptor"; | ||
*/ | ||
close, } from "./fs/file-descriptor"; | ||
export { | ||
/** | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -22,3 +21,2 @@ access, | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
@@ -28,3 +26,2 @@ copyFile, | ||
* @category Constructors | ||
* @since 2.2.0 | ||
*/ | ||
@@ -35,3 +32,2 @@ mkdir, } from "./fs/path"; | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -41,3 +37,2 @@ appendFile, | ||
* @category Constructors | ||
* @since 2.3.0 | ||
*/ | ||
@@ -51,3 +46,2 @@ readFile, } from "./fs/_internal"; | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -60,4 +54,3 @@ export declare function chmod(mode: fs.Mode): ReaderTaskNodeEither<fs.PathLike, void>; | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
export declare function chown(uid: number, gid: number): ReaderTaskNodeEither<fs.PathLike, void>; |
/** | ||
* @since 2.0.0 | ||
*/ | ||
@@ -12,8 +11,7 @@ import { taskEither as TE } from "fp-ts"; | ||
* @category Constructors | ||
* @since 2.1.0 | ||
*/ close, } from "./fs/file-descriptor"; | ||
*/ | ||
close, } from "./fs/file-descriptor"; | ||
export { | ||
/** | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -24,3 +22,2 @@ access, | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
@@ -30,3 +27,2 @@ copyFile, | ||
* @category Constructors | ||
* @since 2.2.0 | ||
*/ | ||
@@ -37,3 +33,2 @@ mkdir, } from "./fs/path"; | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -43,3 +38,2 @@ appendFile, | ||
* @category Constructors | ||
* @since 2.3.0 | ||
*/ | ||
@@ -53,3 +47,2 @@ readFile, } from "./fs/_internal"; | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -64,3 +57,2 @@ export function chmod(mode) { | ||
* @category Constructors | ||
* @since 2.0.0 | ||
*/ | ||
@@ -67,0 +59,0 @@ export function chown(uid, gid) { |
@@ -27,3 +27,6 @@ /// <reference types="node" /> | ||
flag?: string; | ||
}): ReaderTaskNodeEither<PathLikeOrFD, Buffer>; | ||
export declare function readFile(options?: { | ||
flag?: string; | ||
encoding: BufferEncoding; | ||
}): ReaderTaskNodeEither<PathLikeOrFD, string>; |
@@ -18,12 +18,4 @@ import { taskEither as TE } from "fp-ts"; | ||
} | ||
/** | ||
* Asynchronously reads the entire contents of a file. | ||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol. | ||
* URL support is _experimental_. | ||
* If a file descriptor is provided, the underlying file will _not_ be closed automatically. | ||
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. | ||
* If a flag is not provided, it defaults to `'r'`. | ||
*/ | ||
export function readFile(options) { | ||
return (path) => TE.taskify(fs.readFile)(path, options || { encoding: "utf8" }); | ||
return (path) => TE.taskify(fs.readFile)(path, options); | ||
} |
/// <reference types="node" /> | ||
/** | ||
* @since 4.3.0 | ||
*/ | ||
import { WriteFileOptions } from "fs"; | ||
@@ -9,3 +6,2 @@ import { FileDescriptor, ReaderTaskNodeEither } from "./types"; | ||
* @category Constructors | ||
* @since 4.2.0 | ||
*/ | ||
@@ -18,12 +14,10 @@ export declare const appendFile: (options?: WriteFileOptions) => (data: string | Uint8Array) => ReaderTaskNodeEither<FileDescriptor, void>; | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
export declare const close: ReaderTaskNodeEither<FileDescriptor, void>; | ||
/** | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
export declare const readFile: (options?: { | ||
flag?: string | undefined; | ||
export declare function readFile(options?: { | ||
flag?: string; | ||
}): ReaderTaskNodeEither<FileDescriptor, Buffer>; | ||
export declare function readFile(options?: { | ||
flag?: string; | ||
encoding: BufferEncoding; | ||
}) => ReaderTaskNodeEither<FileDescriptor, string>; | ||
}): ReaderTaskNodeEither<FileDescriptor, string>; |
@@ -0,7 +1,8 @@ | ||
/** | ||
*/ | ||
import { taskEither as TE } from "fp-ts"; | ||
import * as fs from "fs"; | ||
import * as internal from "./_internal"; | ||
import { taskEither as TE } from "fp-ts"; | ||
/** | ||
* @category Constructors | ||
* @since 4.2.0 | ||
*/ | ||
@@ -14,3 +15,2 @@ export const appendFile = internal.appendFile; | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
@@ -20,4 +20,5 @@ export const close = TE.taskify(fs.close); | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
export const readFile = internal.readFile; | ||
export function readFile(options) { | ||
return internal.readFile(options); | ||
} |
/// <reference types="node" /> | ||
/** | ||
* @since 4.3.0 | ||
*/ | ||
@@ -17,10 +16,9 @@ import { option as O } from "fp-ts"; | ||
export declare function access(mode?: number): ReaderTaskNodeEither<fs.PathLike, void>; | ||
/** | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
export declare const readFile: (options?: { | ||
flag?: string | undefined; | ||
export declare function readFile(options?: { | ||
flag?: string; | ||
}): ReaderTaskNodeEither<fs.PathLike, Buffer>; | ||
export declare function readFile(options?: { | ||
flag?: string; | ||
encoding: BufferEncoding; | ||
}) => ReaderTaskNodeEither<fs.PathLike, string>; | ||
}): ReaderTaskNodeEither<fs.PathLike, string>; | ||
/** | ||
@@ -39,3 +37,2 @@ * Asynchronously append data to a file, creating the file if it does not exist. | ||
* @category Constructors | ||
* @since 4.0.0 | ||
*/ | ||
@@ -57,3 +54,2 @@ export declare const appendFile: (options?: fs.WriteFileOptions) => (data: string | Uint8Array) => ReaderTaskNodeEither<fs.PathLike, void>; | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
@@ -77,4 +73,3 @@ export declare function copyFile(options: ({ | ||
* @category Constructors | ||
* @since 3.2.0 | ||
*/ | ||
export declare function mkdir(options?: fs.Mode | fs.MakeDirectoryOptions): ReaderTaskNodeEither<fs.PathLike, O.Option<string>>; |
/** | ||
* @since 4.3.0 | ||
*/ | ||
@@ -21,5 +20,6 @@ import { option as O, taskEither as TE } from "fp-ts"; | ||
* @category Constructors | ||
* @since 4.4.0 | ||
*/ | ||
export const readFile = internal.readFile; | ||
export function readFile(options) { | ||
return internal.readFile(options); | ||
} | ||
/** | ||
@@ -38,3 +38,2 @@ * Asynchronously append data to a file, creating the file if it does not exist. | ||
* @category Constructors | ||
* @since 4.0.0 | ||
*/ | ||
@@ -56,3 +55,2 @@ export const appendFile = internal.appendFile; | ||
* @category Constructors | ||
* @since 3.0.0 | ||
*/ | ||
@@ -72,3 +70,2 @@ export function copyFile(options) { | ||
* @category Constructors | ||
* @since 3.2.0 | ||
*/ | ||
@@ -75,0 +72,0 @@ export function mkdir(options) { |
@@ -9,3 +9,2 @@ /// <reference types="node" /> | ||
* @category Model | ||
* @since 3.1.0 | ||
*/ | ||
@@ -12,0 +11,0 @@ export interface ReaderTaskNodeEither<R, A> extends readerTaskEither.ReaderTaskEither<R, NodeJS.ErrnoException, A> { |
{ | ||
"name": "fp-ts-node", | ||
"version": "4.4.0", | ||
"version": "5.0.0", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "dist" |
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
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
50106
1008