Validate the name of a custom element
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig meta tweaks Jun 21, 2016
.gitattributes
.gitignore
.travis.yml meta tweaks Jun 21, 2016
cli.js
index.js
license
package.json 2.1.1 Jun 24, 2016
readme.md
test.js

readme.md

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