Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zoubin/compare-directory
Compare contents of two directories
https://github.com/zoubin/compare-directory
Last synced: 8 days ago
JSON representation
Compare contents of two directories
- Host: GitHub
- URL: https://github.com/zoubin/compare-directory
- Owner: zoubin
- License: mit
- Created: 2015-11-09T09:52:58.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-03T09:10:03.000Z (over 8 years ago)
- Last Synced: 2024-11-04T00:51:50.465Z (15 days ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# compare-directory
Compare contents of two directories.[![version](https://img.shields.io/npm/v/compare-directory.svg)](https://www.npmjs.org/package/compare-directory)
[![status](https://travis-ci.org/zoubin/compare-directory.svg?branch=master)](https://travis-ci.org/zoubin/compare-directory)
[![dependencies](https://david-dm.org/zoubin/compare-directory.svg)](https://david-dm.org/zoubin/compare-directory)
[![devDependencies](https://david-dm.org/zoubin/compare-directory/dev-status.svg)](https://david-dm.org/zoubin/compare-directory#info=devDependencies)## Usage
```javascript
var test = require('tape')
var compare = require('compare-directory')
var path = require('path')
var fixtures = path.resolve.bind(path, __dirname, 'fixtures')test('compare directories', function(t) {
compare(t, ['**/*.css', '**/*.png'], fixtures('actual'), fixtures('expected'))
t.end()
})test('normalize', function(t) {
compare(t, ['**/*.css', '**/*.scss', '**/*.png'], fixtures('normalize'), fixtures('expected'), function (file) {
if (path.extname(file) !== '.scss') {
return file
}
return path.join(
path.dirname(file), path.basename(file, '.scss') + '.css'
)
})
t.end()
})```