1.1.0 • Published 2 years ago

demo-npm-cli-tool v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Pathmap Generator for 'Pages' directory of Next.js

Requirements

  • node.js >= 14.0.0

Core dependencies

How to use

npx script running fashion.

npx demo-npm-cli-tool # cannot define config file.
or
npm install demo-npm-cli-tool

Configuration vs. Cli Interactions

To configure required properties you should define either configuration in pathmap.config.json or via CLI-input.

pathmap.config.json

{
  "pathToPages": "src/pages",
  "pathToSave": "path/path.json",
  "includes": ["**/*.page.{ts,tsx}"],
  "excludes": ["!node_modules"], // remember, path expression in excludes must start with exclamation mark.
  "schema": {
    "query": []
    // any key:value pairs..
  }
}

Interactive CLI Dialogs.

? Enter the path to the '/pages' directory. src/pages
? Enter the destination to save jsonized pathmap file. pathmap/pathmap.json
? includes: **/*.page.{ts,tsx}
? excludes: **/[!_]*.{ts,tsx}, **/[!A-Z]*.page.{ts,tsx}, !api

Result

{
  "/": {
    "alias": "",
    "trackPageView": true,
    "query": []
  },
  "/services/loan": {
    "alias": "",
    "trackPageView": true,
    "query": []
  }
}

© WONKOOK LEE

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago