ngtmplchck

Detect AngularJS files that have broken template references

Usage no npm install needed!

<script type="module">
  import ngtmplchck from 'https://cdn.skypack.dev/ngtmplchck';
</script>

README

ngtmplchck

Detect AngularJS files that have broken template url references.

Usage

Arguments

DIR - Path to search for files with broken template references. Required.

options.skipGlobs - Ignore directories or files that match any of the globs. It uses minimatch with default options to match globs.

Example

ngtmplchck DIR --skip-globs '**/.bower/**' '**/build/**' '**/*.spec.js' from the terminal.

Or in node.js,

var ngtmplchck = require('ngtmplchck');

var opts = {};
opts.skipGlobs = ['**/.bower/**', '**/build/**', '**/*.spec.js'];

ngtmplchck(dir, opts, function (exitCode) {
  // exitCode is 0 if no broken references are found; otherwise, it is 1.
});

The code above will scan all files in DIR, and make sure that all templateUrl strings map to an existing file somewhere in DIR.

Tests

Tests require access to a filesystem in which to setup and tear down directory fixtures. Using a ramdisk is recommended.

DIR_FIXTURE_PATH=[path] npm run test