Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flamencist/selectorgenerator
JavaScript object that creates a unique CSS selector for a given DOM element. It has no external dependencies.
https://github.com/flamencist/selectorgenerator
css css-selector javascript parser
Last synced: 11 days ago
JSON representation
JavaScript object that creates a unique CSS selector for a given DOM element. It has no external dependencies.
- Host: GitHub
- URL: https://github.com/flamencist/selectorgenerator
- Owner: flamencist
- Created: 2017-05-11T16:31:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-01T23:07:03.000Z (over 4 years ago)
- Last Synced: 2024-12-28T00:32:18.259Z (11 days ago)
- Topics: css, css-selector, javascript, parser
- Language: JavaScript
- Size: 73.2 KB
- Stars: 20
- Watchers: 1
- Forks: 7
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SelectorGenerator
[![Built with Gulp](http://img.shields.io/badge/built%20with-gulp.js-red.svg)](http://gulpjs.com/)
[![devDependency Status](https://david-dm.org/flamencist/SelectorGenerator/dev-status.svg)](https://david-dm.org/flamencist/SelectorGenerator#info=devDependencie)
[![Build Status](https://secure.travis-ci.org/flamencist/SelectorGenerator.svg)](http://travis-ci.org/flamencist/SelectorGenerator)JavaScript object that creates a unique CSS selector for a given DOM element. It has no external dependencies.
Help support the project:## Overview
var generator = new SelectorGenerator();
var element = document.querySelector("input"); //
var selector = generator.getSelector(element); //=> #login
var path = generator.getPath(element); //=> body > div > input## Installation
### Node.js
To install __SelectorGenerator__ module for Node.js, this command should be used:
npm install selector-generator
Or [yarn](https://yarnpkg.com/lang/en/):yarn add selector-generator
## Tests
You can view the results of the SelectorGenerator test suite [in your browser!](https://rawgit.com/flamencist/SelectorGenerator/master/spec-runner.html)
### License
This software is distributed under the terms of the MIT License (MIT).
### Authors
Alexander Chermyanin / [LinkedIn](https://www.linkedin.com/in/alexander-chermyanin)
Contributions and bugs reports are welcome.