New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

index-tasukaru

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

index-tasukaru - npm Package Compare versions

Comparing version 0.0.1 to 0.0.3

26

lib/index.js

@@ -31,3 +31,3 @@ "use strict";

let argv = minimist_1.default(process.argv.slice(2), {
boolean: ['f'],
boolean: ['f', 'version'],
string: ['sourceExts'],

@@ -38,2 +38,5 @@ default: {

});
if (argv.version) {
exit(`${(yield getPackageJson()).version}`);
}
let targetDir = (_a = argv._[0]) !== null && _a !== void 0 ? _a : '.';

@@ -52,11 +55,22 @@ let workDir = path_1.default.join(process.cwd(), targetDir);

let matchedFiles = files
// Skip dotfiles
.filter((f) => !!getExportName(f))
// Skip dotfiles and target file
.filter((f) => !!getExportName(f) && f !== targetIndex)
.filter((f) => matchExts(sourceExts, f));
if (!matchedFiles.length) {
exitWithError(`No files matched.`, 2);
}
let indexLines = matchedFiles.map(getExportDefaultFromLine);
let indexSource = indexLines.join('\n');
yield fs_extra_1.default.writeFile(targetIndexPath, indexSource + '\n');
echo(`Finished exporting ${matchedFiles.length} file(s).`);
});
}
exports.main = main;
function echo(message) {
console.log(message);
}
function exit(message) {
message && console.log(message);
process.exit(0);
}
function exitWithError(message, code) {

@@ -83,1 +97,7 @@ console.error(`Error: ${message}`);

}
function getPackageJson() {
return __awaiter(this, void 0, void 0, function* () {
let config = yield fs_extra_1.default.readFile(path_1.default.join(__dirname, '../package.json'), 'utf-8');
return JSON.parse(config);
});
}

5

package.json
{
"name": "index-tasukaru",
"description": "Generate index file from CLI.",
"version": "0.0.1",
"version": "0.0.3",
"preferGlobal": true,

@@ -12,3 +12,4 @@ "bin": {

"dev": "tsc --watch",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "rm -rf lib/ && yarn build"
},

@@ -15,0 +16,0 @@ "repository": {

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