diff-dir-file

directory compare and show the difference of files

Usage no npm install needed!

<script type="module">
  import diffDirFile from 'https://cdn.skypack.dev/diff-dir-file';
</script>

README

Welcome to diff-dir-file 👋

Version Documentation Maintenance License: MIT

directory compare and show the difference of files

🏠 Homepage

Install

npm install diff-dir-file

Usage

const diff = require('diff-dir-file')
diff(path1, path2).then(res => {
  // do something
  // ....
})

Return

dirDiff returns Promise. Fulfilled value -Object in following format:

// the filename of the diff
interface IOut {
  name: IInner 
}
// the lineCount of the file
interface IInner{
  index: String[] // length: 2 , File A and File B
}

// For example

//a/a.js
function a() {
  console.log(1)
}
// b/a.js
function b() {
  console.log(2)
}

// result
{
  'a.js': {
    '1': ['function a() {' , 'function b() {'],
    '2': ['console.log(1)', 'console.log(2)'],
  }
}

Author

👤 sillyy

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 sillyy.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator