Neutered Paranoid Meerkat
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

validate-element-name

2.1.1 • Public • Published

validate-element-name Build Status

Validate the name of a custom element

Custom element names should start with a-z and contain a-z and at least one - with optionally 0-9.

You should not use the x-, polymer-, ng- prefixes.

Install

$ npm install --save validate-element-name

Usage

const validate = require('validate-element-name');
 
validate('unicorn');
//=> {isValid: false, message: 'Custom element names must contain a hyphen. Example: unicorn-cake'}

See cli.js for real-world usage.

CLI

$ npm install --global validate-element-name
$ validate-element-name --help

  Usage
    $ validate-element-name <element-name>

  Example
    $ validate-element-name s-slider
    ✔︎ Valid element name.

License

MIT © Sindre Sorhus

install

npm i validate-element-name

Downloadsweekly downloads

5,650

version

2.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability