Skip to content

htmlacademy/project-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

project-search

NPM version Build status

Module to search files in your project

Install

$ npm install @htmlacademy/project-search

Usage

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 HTML files in project path
  • css(projectPath) — returns an Array with all CSS files in project path
  • js(projectPath) — returns an Array with all JavaScript files in project path
  • images(projectPath) — returns an Array with all images in project path. Include jpeg, jpg, png, gif, png, svg, webp, bmp files;
  • styles(projectPath) — returns an Array with all files with styles definition. Include css, less, sass, scss, pcss, postcss files;
  • type(projectPath, type) — returns an Array of all files with type extension in project path
  • file(projectPath, file) — returns one file with name file in project path
  • dir(projectPath, dir) — returns an Array of all directories with name dir. If dir isn't set, returns all directories in project path

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published