Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wankdanker/node-find-alternate-file

Given a file path and a list of file extensions, find a file that exists
https://github.com/wankdanker/node-find-alternate-file

Last synced: 2 months ago
JSON representation

Given a file path and a list of file extensions, find a file that exists

Awesome Lists containing this project

README

        

find-alternate-file
-------------------

Say your are looking for index.html, but if it does not exist you are willing
to use index.jade, index.ejs or index.dust. This module will help you determine
which if any of the alternate files exist.

install
-------

```bash
npm install find-alternate-file
```

usage
-----

###async

```js
var find = require('find-alternate-file');

find('index.html', ['jade', 'ejs', 'dust'], function (err, found) {
console.log(found);
});

```
###sync

```js
var findSync = require('find-alternate-file').findSync;

console.log(findSync('index.html', ['jade', 'ejs', 'dust']));
```

license
-------

MIT