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

next-routes-readme

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-routes-readme - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

lib/utils/validator.js

1

lib/config/constants.js

@@ -6,3 +6,4 @@ "use strict";

routeFilename: 'route',
markdownFilename: 'ROUTES.md',
});
//# sourceMappingURL=constants.js.map

21

lib/index.js

@@ -8,2 +8,3 @@ #!/usr/bin/env node

const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
const constants_1 = require("./config/constants");

@@ -13,5 +14,5 @@ const parser_1 = require("./route-parser/parser");

const generateMarkdown_1 = require("./utils/generateMarkdown");
const validator_1 = require("./utils/validator");
const folderPath = process.argv[2];
async function main() {
fs_1.default.writeFileSync('ROUTES.md', ''); // Clear existing content or create new file
const folderPath = process.argv[2];
await (0, traverseDictory_1.traverseDirectory)(folderPath, async (file) => {

@@ -22,13 +23,21 @@ try {

const handlers = (0, parser_1.parseRouteHandlers)(file);
fs_1.default.writeFileSync(constants_1.constants.markdownFilename, '');
for (const handler of handlers) {
await (0, generateMarkdown_1.generateMarkdownOutput)([handler], file);
return await (0, generateMarkdown_1.generateMarkdownOutput)([handler], file);
}
}
}
catch (error) {
console.error(`Error processing file ${file}:`, error);
catch (_a) {
return Promise.reject(new Error(`Error while parsing file ${file}.`));
}
});
}
main();
(0, validator_1.checkIfFolderExists)(folderPath)
.then(() => main())
.then(() => {
const projectRoot = path_1.default.resolve(process.cwd());
const filePath = path_1.default.resolve(projectRoot, constants_1.constants.markdownFilename);
console.log(`Finished. Please check ${filePath}`);
})
.catch(error => console.error(error.message));
//# sourceMappingURL=index.js.map

@@ -19,8 +19,9 @@ "use strict";

else {
fileCallback(filePath, parentFolderName);
return fileCallback(filePath, parentFolderName);
}
}
return Promise.reject(Error(`There are no Next.js Route files for path ${directory}.`));
}
catch (error) {
console.error(`Error while traversing directory ${directory}:`, error);
return Promise.reject(new Error(`Error while traversing directory ${directory}.`));
}

@@ -27,0 +28,0 @@ }

{
"name": "next-routes-readme",
"version": "0.0.9",
"version": "0.0.10",
"description": "Creates README badges from istanbul coverage report",

@@ -5,0 +5,0 @@ "type": "commonjs",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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