@transloadit/file-exists
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -1,1 +0,2 @@ | ||
export default function fileExists(path: string): Promise<boolean>; | ||
declare const _default: (path: string) => Promise<boolean>; | ||
export = _default; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs_1 = __importDefault(require("fs")); | ||
function fileExists(path) { | ||
const fs = require("node:fs"); | ||
module.exports = function fileExists(path) { | ||
return new Promise((resolve) => { | ||
fs_1.default.access(path, fs_1.default.constants.F_OK, (err) => { | ||
fs.access(path, fs.constants.F_OK, (err) => { | ||
resolve(!err); | ||
}); | ||
}); | ||
} | ||
exports.default = fileExists; | ||
}; | ||
//# sourceMappingURL=fileExists.js.map |
{ | ||
"name": "@transloadit/file-exists", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"repository": { | ||
@@ -12,14 +12,11 @@ "type": "git", | ||
"types": "dist/fileExists.d.ts", | ||
"directories": { | ||
"lib": "dist", | ||
"test": "dist" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: run tests from root\" && exit 1", | ||
"tsc": "tsc --build --clean && tsc --build" | ||
"build": "tsc --build --clean && tsc --build", | ||
"typecheck": "tsc --noEmit", | ||
"test": "tsx --test src/**/*.test.ts", | ||
"test:watch": "tsx --test --watch src/**/*.test.ts" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"gitHead": "412a97c914bd1a8c6d21df01c9f7e18ab19b218a" | ||
} | ||
} |
@@ -0,3 +1,3 @@ | ||
import assert from 'node:assert' | ||
import { describe, test } from 'node:test' | ||
import assert from 'node:assert' | ||
import fileExists from './fileExists' | ||
@@ -4,0 +4,0 @@ |
@@ -1,2 +0,2 @@ | ||
import fs = require('fs') | ||
import fs = require('node:fs') | ||
@@ -3,0 +3,0 @@ export = function fileExists(path: string): Promise<boolean> { |
Sorry, the diff of this file is not supported yet
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
36672
11
36