Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
nodejs 下文件相关封装
'use strict';
var q = require('qiao-file');
var test = function () {
var folderPath = './test/';
var filePath = './qiao-file.js';
// cp folder
q.cp(folderPath, './test1');
// cp file
q.cp(filePath, './1.js');
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var oldPath = './test';
var newPath = './test1';
var res = q.mv(oldPath, newPath);
console.log(res);
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var folderPath = 'd:/test1/';
var filePath = 'd:/test.png';
// rm folder
q.rm(folderPath);
// rm file
q.rm(filePath);
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var foldersAndFiles = q.lsdir('z:/workspaces/qiao.plugin.coder/');
console.log(foldersAndFiles);
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var fileTree = q.lstree('./', ['node_modules']);
console.log(JSON.stringify(fileTree));
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var folder = 'd:/test1/test2/test3/test.js';
q.mkdir(folder);
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var filePath = 'd:/test1/test2/test.js';
var s = q.extname(filePath);
console.log(s);
};
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var filePath = './index.js';
var s = q.readFile(filePath);
console.log(s);
};
test();
'use strict';
// q
var q = require('qiao-file');
// run
async function test() {
var filePath = './rm.js';
q.readFileLineByLine(filePath, onLine, onClose);
}
test();
// on line
function onLine(line) {
console.log(line);
}
// on close
function onClose() {
console.log('close');
}
'use strict';
// q
var q = require('qiao-file');
// run
async function test() {
var filePath = './rm.js';
var lines = await q.readFileLineByLineSync(filePath);
console.log(lines);
// clear
filePath = null;
lines = null;
}
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var filePath = './1.js';
q.writeFile(filePath, '2');
};
test();
'use strict';
// q
var q = require('qiao-file');
// run
async function test() {
var filePath = './rm.js';
var destPath = '../dist/rm.js';
var lines = await q.readFileLineByLineSync(filePath);
q.writeFileFromLines(destPath, lines);
// clear
filePath = null;
destPath = null;
lines = null;
}
test();
'use strict';
var q = require('qiao-file');
var test = function () {
var fpath = 'z:/workspaces/qiao.plugin.coder/lib/qiao.plugin.coder.js';
var s = q.isExists(fpath);
console.log(s);
};
test();
FAQs
nodejs file tool
The npm package qiao-file receives a total of 58 weekly downloads. As such, qiao-file popularity was classified as not popular.
We found that qiao-file demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.