Package Exports
- @htmlacademy/project-search
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@htmlacademy/project-search) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
project-search
Module to search files in your project
Install
$ npm install @htmlacademy/project-searchUsage
const search = require(`@htmlacademy/project-search`);
// Find all html files in project
search.html('/path/to/your/project').then((files) => {
files.forEach((file) => {
console.log(file);
})
});API
All methods return a Promise. If the Promise resolves it returns results of search. If promise rejects it returns an error message
- html(projectPath) — returns an Array with all
HTMLfiles in project path - css(projectPath) — returns an Array with all
CSSfiles in project path - js(projectPath) — returns an Array with all
JavaScriptfiles in project path - images(projectPath) — returns an Array with all images in project path. Include
jpeg,jpg,png,gif,png,svg,webp,bmpfiles; - styles(projectPath) — returns an Array with all files with styles definition. Include
css,less,sass,scss,pcss,postcssfiles; - type(projectPath, type) — returns an Array of all files with
typeextension in project path - file(projectPath, file) — returns one file with name
filein project path - dir(projectPath, dir) — returns an Array of all directories with name
dir. Ifdirisn't set, returns all directories in project path