MCPcopy Index your code
hub / github.com/expressjs/generator / createAppName

Function createAppName

bin/express-cli.js:367–372  ·  view source on GitHub ↗

* Create an app name from a directory path, fitting npm naming requirements. * * @param {String} pathName

(pathName)

Source from the content-addressed store, hash-verified

365 */
366
367function createAppName (pathName) {
368 return path.basename(pathName)
369 .replace(/[^A-Za-z0-9.-]+/g, '-')
370 .replace(/^[-_.]+|-+$/g, '')
371 .toLowerCase()
372}
373
374/**
375 * Check if the given directory `dir` is empty.

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected