You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

nextjs-routes-docs

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nextjs-routes-docs - npm Package Compare versions

Comparing version

to
0.0.41

README.md

18

index.js

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

const { text, swagger, params } = options;
const output = options.output ? options.output : ".";
const outputBoth = !text && !swagger;

@@ -118,9 +119,11 @@ const apiDir = path.join(dir, "pages", "api");

if (text || outputBoth) {
writeFileSync("routes", content.join("\n"));
console.log(chalk.green("routes file created"));
const outputPath = path.join(output, "routes");
writeFileSync(outputPath, content.join("\n"));
console.log(chalk.green(`${outputPath} file created`));
}
if (swagger || outputBoth) {
// create swagger api file
writeFileSync("routes.yml", yaml.dump(spec));
console.log(chalk.green("routes.yml file created"));
const outputPath = path.join(output, "routes.yml");
writeFileSync(outputPath, yaml.dump(spec));
console.log(chalk.green(`${outputPath} file created`));
}

@@ -156,5 +159,6 @@ })

.addArgument(new Argument("<dir>", "Nextjs project directory"))
.option("-t, --text", " text docs")
.option("-s, --swagger", "swagger docs")
.option("-p, --params", "[BETA] parse code to get params")
.option("-t, --text", "Produce text docs")
.option("-s, --swagger", "Produce swagger docs")
.option("-p, --params", "[BETA] Parse code to get params")
.option("-o, --output <value>", "Choose output folder")
.action(function (dir, options, command) {

@@ -161,0 +165,0 @@ if (options.params) {

{
"name": "nextjs-routes-docs",
"version": "0.0.3",
"version": "0.0.41",
"description": "Generate docs for nextjs routes",
"bin": {
"nextjs-routes": "./index.js"
"nextjs-routes-docs": "./index.js"
},

@@ -20,2 +20,3 @@ "scripts": {

"dependencies": {
"0g": "^0.0.6",
"acorn": "^8.6.0",

@@ -22,0 +23,0 @@ "chalk": "^4.1.2",