How to use is-text-path - 1 common examples

To help you get started, we’ve selected a few is-text-path examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WilliamHuey / dirgen / src / dirgen-cli-commands.js View on Github external
fs.stat(data[0], (error) => {
              if (error) {
                message(requireValidationMessages.inValidTemplateMsg);
                return reject({
                  file: false
                });
              } else if (!isTextPath(data[0])) {

                //Check for text file
                message(`Not a valid template file. Please
                  provide a plain text file format in
                  the first command input.`);
                return resolve({
                  file: false
                });
              } else {
                return resolve({
                  file: true
                });
              }
            });
          }),

is-text-path

Check if a file path is a text file

MIT
Latest version published 8 months ago

Package Health Score

73 / 100
Full package analysis

Popular is-text-path functions