
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.