CLI tool for scaffolding JavaScript and TypeScript third-party libraries with modern development practices
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Complete project scaffolding functionality for creating new JavaScript and TypeScript library projects with modern development tooling.
Creates a new library project with interactive configuration or pre-specified options.
jslib new [projectname] [options]
jslib n [projectname] [options]
# Options:
--force, -f # Force create (overwrite existing project)
--config, -c # Initialize only the configuration file
--npmname, -n <name> # Initialize the npm package name
--umdname, --umd <name> # Initialize the UMD name for package
--username, -u <name> # Initialize the username
--type, -t <type> # Initialize the js/ts selection
--manager, -m <manager> # Select the package management methodUsage Examples:
# Interactive creation (prompts for all options)
npx @js-lib/cli new my-lib
# Create with specific options
npx @js-lib/cli new my-lib --type js --username johndoe --manager npm
# Force overwrite existing directory
npx @js-lib/cli new existing-project --force
# Create only configuration file in current directory
npx @js-lib/cli new --config --type tsThe CLI handles project creation through the following internal process:
The CLI supports two complete project templates:
Generated projects include:
my-project/
├── src/ # Source code directory
├── test/ # Unit tests
├── demo/ # Usage examples
├── dist/ # Compiled output
├── doc/ # Documentation
├── .github/ # GitHub Actions workflows
├── package.json # NPM package configuration
├── rollup.config.js # Build configuration
├── .eslintrc.js # Linting rules
├── .prettierrc.json # Code formatting
└── jslib.json # Project metadata for updatesThe creation process includes validation and error handling:
--force is usedThe --config flag allows initializing only the jslib.json configuration file in the current directory, useful for existing projects that want to enable update functionality.
# Initialize config in existing project
cd existing-project
npx @js-lib/cli new --config --type js