Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Command line app for searching in HTML files for elements that match a CSS selector
Find in Files with CSS selectors.
Element Finder is a command line app for recursively searching through a directory and finding HTML files which contain elements matching a given CSS selector. The app is built with Node JS and uses Sizzle as the selector engine - the same selector engine used by jQuery.
Search for elements with a class of awesome-list
:
elfinder -s .awesome-list
Search for elements with a class of awesome-list
which are descendants of an element with a class of colours
:
elfinder -s ".colours .awesome-list"
Search for elements with a class of awesome-list
in files with an extension of html
or shtml
:
elfinder -s .awesome-list -x "html, shtml"
Search for elements matching the ul.boxes .box
selector, but ignore any files in the .git
, .svn
or partials
folders:
elfinder -s "ul.boxes .box" -i ".git, .svn, partials"
Install Node JS: http://nodejs.org/#download
Install elfinder globally with npm (npm comes with Node JS):
npm install -g elfinder
Element Finder is a command line tool so it is best to install in globally with npm.
Install Node JS: http://nodejs.org/#download
Get the Element Finder source. Download it or clone it from GitHub: https://github.com/keeganstreet/element-finder
CD into the element-finder directory
Install the dependencies with npm (npm comes with Node JS):
npm install
Make the element-finder.js script exectutable:
chmod +x element-finder.js
Add a symlink to the element-finder.js script from a directory in your PATH:
6.1. Check what your path variable is set to:
echo $PATH
6.2. Check that /usr/local/bin is in your path. If not:
sudo mkdir /usr/local/bin
6.3. Assuming that /usr/local/bin is present in your PATH, create a link from there to element-finder.js
ln -s "/Users/kestreet/Dropbox/Projects/element-finder/element-finder.js" /usr/local/bin/elfinder
Crack open a beer.
Note: The first two steps are included because one of Element Finder's dependencies, jsdom, requires Python and Microsoft Visual C++ 2010 to compile.
Install Python 2.7.
Install Microsoft Visual C++ 2010.
Install Node JS: http://nodejs.org/#download
Get the Element Finder source. Download it or clone it from GitHub: https://github.com/keeganstreet/element-finder
CD into the element-finder directory
Install the dependencies with npm (npm comes with Node JS):
npm install
Note: If this step fails and the error message mentions JSDom or Contextify, the instructions for Installing JSDom on Windows may help.
I don't know of a way of making specific JavaScript files like element-finder.js executable on Windows, so to run Element Finder on Windows, you will need to follow these steps:
7.1. CD into the directory you want to search.
7.2. Tell Node to run element-finder.js:
node c:\path\to\element-finder.js -s ".awesome-list"
Have you created the symlink properly? Run open /usr/local/bin/
and see if the elfinder
link opens the element-finder.js
script.
FAQs
Command line app for searching in HTML files for elements that match a CSS selector
The npm package elfinder receives a total of 34 weekly downloads. As such, elfinder popularity was classified as not popular.
We found that elfinder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.