Sha256: 67b2dadfab7f59b01cf74fae9d958f3f721d58115480dbf6db761d109c92a1d8

Contents?: true

Size: 1.7 KB

Versions: 53

Compression:

Stored size: 1.7 KB

Contents

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = void 0;
var fs = require("fs");
function fileExistsSync(path) {
    try {
        var stats = fs.statSync(path);
        return stats.isFile();
    }
    catch (err) {
        // If error, assume file did not exist
        return false;
    }
}
exports.fileExistsSync = fileExistsSync;
/**
 * Reads package.json from disk
 * @param file Path to package.json
 */
// tslint:disable-next-line:no-any
function readJsonFromDiskSync(packageJsonPath) {
    if (!fs.existsSync(packageJsonPath)) {
        return undefined;
    }
    return require(packageJsonPath);
}
exports.readJsonFromDiskSync = readJsonFromDiskSync;
function readJsonFromDiskAsync(path, 
// tslint:disable-next-line:no-any
callback) {
    fs.readFile(path, "utf8", function (err, result) {
        // If error, assume file did not exist
        if (err || !result) {
            return callback();
        }
        var json = JSON.parse(result);
        return callback(undefined, json);
    });
}
exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
function fileExistsAsync(path2, callback2) {
    fs.stat(path2, function (err, stats) {
        if (err) {
            // If error assume file does not exist
            return callback2(undefined, false);
        }
        callback2(undefined, stats ? stats.isFile() : false);
    });
}
exports.fileExistsAsync = fileExistsAsync;
function removeExtension(path) {
    return path.substring(0, path.lastIndexOf(".")) || path;
}
exports.removeExtension = removeExtension;
//# sourceMappingURL=filesystem.js.map

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
rapid_stack-0.2.0 templates/frontend/node_modules/tsconfig-paths/lib/filesystem.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/tsconfig-paths/lib/filesystem.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.60 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.59 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.58 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.57 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.56 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.55 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.54 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.53 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.52 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.51 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.50 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.49 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.48 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.47 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.46 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.45 node_modules/tsconfig-paths/lib/filesystem.js
immosquare-cleaner-0.1.44 node_modules/tsconfig-paths/lib/filesystem.js