@transloadit/file-exists
Advanced tools
Comparing version 0.3.4 to 1.0.0
@@ -1,2 +0,1 @@ | ||
declare const _default: (path: string) => Promise<boolean>; | ||
export = _default; | ||
export declare function fileExists(path: string): Promise<boolean>; |
"use strict"; | ||
const fs = require("node:fs"); | ||
module.exports = function fileExists(path) { | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fileExists = fileExists; | ||
const node_fs_1 = __importDefault(require("node:fs")); | ||
function fileExists(path) { | ||
return new Promise((resolve) => { | ||
fs.access(path, fs.constants.F_OK, (err) => { | ||
node_fs_1.default.access(path, node_fs_1.default.constants.F_OK, (err) => { | ||
resolve(!err); | ||
}); | ||
}); | ||
}; | ||
} | ||
//# sourceMappingURL=fileExists.js.map |
{ | ||
"name": "@transloadit/file-exists", | ||
"version": "0.3.4", | ||
"version": "1.0.0", | ||
"repository": { | ||
@@ -12,7 +12,11 @@ "type": "git", | ||
"types": "dist/fileExists.d.ts", | ||
"files": [ | ||
"dist", | ||
"src", | ||
"!*.test.*" | ||
], | ||
"scripts": { | ||
"build": "tsc --build --clean && tsc --build", | ||
"typecheck": "tsc --noEmit", | ||
"test": "tsx --test src/**/*.test.ts", | ||
"test:watch": "tsx --test --watch src/**/*.test.ts" | ||
"prepack": "tsc --build", | ||
"test": "tsc --build && node --test --enable-source-maps", | ||
"test:watch": "node --test --enable-source-maps --watch" | ||
}, | ||
@@ -19,0 +23,0 @@ "publishConfig": { |
@@ -1,4 +0,4 @@ | ||
import fs = require('node:fs') | ||
import fs from 'node:fs' | ||
export = function fileExists(path: string): Promise<boolean> { | ||
export function fileExists(path: string): Promise<boolean> { | ||
return new Promise((resolve) => { | ||
@@ -5,0 +5,0 @@ fs.access(path, fs.constants.F_OK, (err) => { |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
36416
7
23