Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qiao-file

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qiao-file - npm Package Compare versions

Comparing version 4.5.3 to 4.5.4

50

index.js

@@ -6,2 +6,4 @@ 'use strict';

var Debug = require('debug');
var os = require('os');
var qiaoEncode = require('qiao-encode');
var readline = require('readline');

@@ -38,3 +40,3 @@

// fs
const debug$6 = Debug('qiao-file');
const debug$7 = Debug('qiao-file');

@@ -51,3 +53,3 @@ /**

if (!srcExists) {
debug$6('/ cp / src not exists');
debug$7('/ cp / src not exists');
return;

@@ -57,7 +59,7 @@ }

await fsExtra.copy(src, dest);
debug$6('/ cp / success');
debug$7('/ cp / success');
return true;
} catch (e) {
debug$6('/ cp / fail');
debug$7('/ cp / fail');
console.log(e);

@@ -68,3 +70,3 @@ }

// fs
const debug$5 = Debug('qiao-file');
const debug$6 = Debug('qiao-file');

@@ -80,3 +82,3 @@ /**

if (!srcExists) {
debug$5('/ mv / src not exists');
debug$6('/ mv / src not exists');
return;

@@ -86,7 +88,7 @@ }

await fsExtra.move(oldPath, newPath, { overwrite: true });
debug$5('/ mv / success');
debug$6('/ mv / success');
return true;
} catch (e) {
debug$5('/ mv / fail');
debug$6('/ mv / fail');
console.log(e);

@@ -97,3 +99,3 @@ }

// fs
const debug$4 = Debug('qiao-file');
const debug$5 = Debug('qiao-file');

@@ -108,7 +110,7 @@ /**

await fsExtra.remove(fpath);
debug$4('/ rm / success');
debug$5('/ rm / success');
return true;
} catch (e) {
debug$4('/ rm / fail');
debug$5('/ rm / fail');
console.log(e);

@@ -118,2 +120,27 @@ }

// os
const debug$4 = Debug('qiao-file');
/**
* mk dir
* @param {*} dir
* @returns
*/
const tmpdir = async () => {
try {
const tmpPath = os.tmpdir();
const randomFolder = qiaoEncode.uuid();
const tmpDir = path.resolve(tmpPath, randomFolder);
debug$4('/ tmpdir / ', tmpDir);
await fsExtra.ensureDir(tmpDir);
debug$4('/ tmpdir / success');
return true;
} catch (e) {
debug$4('/ tmpdir / fail');
console.log(e);
}
};
// fs

@@ -402,2 +429,3 @@ const debug$3 = Debug('qiao-file');

exports.rm = rm;
exports.tmpdir = tmpdir;
exports.writeFile = writeFile;
{
"name": "qiao-file",
"version": "4.5.3",
"version": "4.5.4",
"description": "nodejs file tool",

@@ -51,3 +51,3 @@ "keywords": [

},
"gitHead": "0ce84380c667b8b2aa3b5c0dc6448ee42fceae41"
"gitHead": "06a6d5286e0f141aa57e357069ce1bfbba2338f5"
}

@@ -11,2 +11,3 @@ // fs & path

// dir
export * from './tmpdir.js';
export * from './mkdir.js';

@@ -13,0 +14,0 @@ export * from './readdir.js';

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