
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
npm i fs-extend -S
const fsEx = require('fs-extend')
fsEx.mkdir('./1/2/3/4/5/6/7/8/9', (err) => {
if (err) {
return console.error(err)
}
console.log('ok')
})
mkdir(path, callback) 递归建立目录mkdirSync(path) 同步递归建立目录rm(path, callback) 删除目录及子目录rmSync(path) 同步删除目录及子目录find(path, pattern, callback) 查找path目录及子目录下匹配pattern的文件和目录。findSync(path, pattern) 同步查找path目录及子目录下匹配pattern的文件和目录。listFiles(path, callback) 列出目录及子目录下所有文件listFilesSync(path) 同步列出目录及子目录所有文件empty(path, callback) 判断目录是否空目录emptySync(path) 同步判断目录是否空目录path <string> 目录路径callback <Function>
err <Error>递归建立目录
fsEx.mkdir('./1/2/3/4/5/6/7/8/9', (err) => {
if (err) {
return console.error(err)
}
console.log('ok')
})
同步递归建立目录
path <string>try {
fsEx.mkdirSync('./1/2/3/4/5/6/7/8/9')
console.log('ok')
} catch (err) {
console.error(err)
}
删除目录及子目录
path <string> 目录路径callback <Function>
err <Error>fsEx.rm('./1', (err) => {
if (err) {
return console.error(err)
}
console.log('ok')
})
同步删除目录及子目录。
path <string> 删除的目录try {
fsEx.rmSync('./1')
console.log('ok')
} catch (err) {
console.error(err)
}
查找path目录及子目录下匹配pattern的文件和目录。
path <string> 查找的目录。pattern <string> | <RegExp> 查找的模式。callback <Function>
err <Error>result <string[]> 查找的结果。fsEx.find('.', '.jpg', (err, result) => {
if (err) {
return console.error(err)
}
console.log(result)
})
同步查找path目录及子目录下匹配pattern的文件和目录。
path <string> 目录路径。pattern <string> | <RegExp> 查找的模式。try {
const result = fsEx.findSync('.', '.jpg')
console.log(result)
} catch (err) {
console.error(err)
}
列出目录及子目录下所有文件。
path <string>callback <Function>
err <Error>result <string[]> 文件列表。fsEx.listFiles('.', (err, result) => {
if (err) {
return console.error(err)
}
console.log(result)
})
同步列出目录及子目录所有文件。
try {
const result = fsEx.listFilesSync('.')
console.log(result)
} catch (err) {
console.error(err)
}
判断目录是否空目录
fsEx.empty('.', (err, isEmpty) => {
if (err) {
return console.error(err)
}
console.log('isEmpty: %s', isEmpty)
})
同步判断目录是否空目录。
path <string>try {
const isEmpty = fsEx.emptySync('.')
console.log('isEmpty: %s', isEmpty)
} catch (err) {
console.error(err)
}
FAQs
提供扩展原生fs模块不支持的功能
The npm package fs-extend receives a total of 9 weekly downloads. As such, fs-extend popularity was classified as not popular.
We found that fs-extend demonstrated a not healthy version release cadence and project activity because the last version was released 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
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.