
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
create-lit-component
Advanced tools
A command-line tool to generate Lit web components with a standardized structure.
You can use this generator with npm's create command:
# Using npm
npm create lit-component my-awesome-component
# Using npm
npx create-lit-component my-awesome-component
# Using yarn
yarn create lit-component my-awesome-component
# Using pnpm
pnpm create lit-component my-awesome-component
Or you can install it globally and use it:
# Install globally
npm install -g create-lit-component
# Then use it
create-lit-component
When using the CLI, you'll be prompted for information, or you can provide it via command-line options:
--name: Name of the component--tags: Add tags to the component (comma separated)--directory: Specify a directory for the component (default: current directory)--description: Description of the component--yes: Skip all prompts and use default valuesExample:
npm create lit-component -- --name my-counter --tags ui,counter --directory components
Note: When using npm create with arguments, you need to add -- before passing arguments.
The generator will create a new Lit component with the following structure:
my-component/
├── README.md
├── package.json
├── tsconfig.json
├── src/
│ ├── index.ts
│ └── lib/
│ └── my-component.ts
└── test/
└── my-component.test.ts
This generator uses the following technologies:
ejs: For template renderingfs-extra: For enhanced file system operationsyargs and inquirer: For interactive CLI experienceglob: For file pattern matchingWe welcome contributions to improve the generator! Here's how you can help:
Clone the repository
git clone https://github.com/yourusername/create-lit-component.git
cd create-lit-component
Install dependencies
npm install
Build the project
npm run build
Test locally
node dist/cli.js
import { x } from './y.js')mainnpm run build)When adding or modifying the component templates:
src/generators/component/files/.template extension for files that need EJS processing<%= variableName %> syntax for template variablesnpm run build
The project includes comprehensive unit tests using Vitest. To run the tests:
# Run tests once
npm test
# Run tests in watch mode during development
npm run test:watch
# Run tests with coverage report
npm run test:coverage
Tests are organized in the tests/ directory:
generators/component/generator.test.ts: Tests for component generator functionscli.test.ts: Tests for CLI functionalitynpm publish
FAQs
A generator for creating Lit web components
We found that create-lit-component demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.