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

check-chinese

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-chinese - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

28

index.js

@@ -6,17 +6,21 @@ #!/usr/bin/env node

// 测试1
function walkSync(currentDirPath, callback) {
// http://nodejs.cn/api/fs.html#fsreaddirsyncpath-options
// http://nodejs.cn/api/fs.html#class-fsdirent 新增于: v10.10.0
fs.readdirSync(currentDirPath, { withFileTypes: true }).forEach(function (
dirent
) {
var filePath = path.join(currentDirPath, dirent.name);
if (dirent.isFile()) {
callback(filePath, dirent);
} else if (dirent.isDirectory()) {
walkSync(filePath, callback);
}
});
try {
fs.readdirSync(currentDirPath, { withFileTypes: true }).forEach(function (
dirent
) {
var filePath = path.join(currentDirPath, dirent.name);
if (dirent.isFile()) {
callback(filePath, dirent);
} else if (dirent.isDirectory()) {
walkSync(filePath, callback);
}
});
} catch (error) {
console.log(error);
}
}
// 测试2
walkSync(process.argv[2], function (filePath, stat) {

@@ -23,0 +27,0 @@ const file = fs.readFileSync(filePath, "utf8");

{
"name": "check-chinese",
"version": "1.0.2",
"version": "1.0.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.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