Skip to content

Latest commit

 

History

History
74 lines (58 loc) · 2.56 KB

README.md

File metadata and controls

74 lines (58 loc) · 2.56 KB

torrent-files-library Build Status Coveralls branch Dependency Status Dev Dependency Status License: MIT semantic-release

Enables to get a library of downloaded torrent files (movie or tv show) from a directory

Installation

For npm users :

$ npm install --save torrent-files-library

for Yarn :

$ yarn add torrent-files-library

Demo

const TorrentLibrary = require("torrent-files-library");

let paths = [
	"D:\\DDL\\FILMS", // a path where I can find both movies and tv-series
	"D:\\DDL\\SERIES TV\\Le juge et le pilote" // a path where I can find episodes of a tv-serie
];

// create an instance
let libInstance = new TorrentLibrary();

// add these paths inside this lib
libInstance
	.addNewPath(...paths)
	.then( (message) => {
		console.log(message);
		return libInstance.scan();
	})
	.then( (otherMessage) => {
		console.log(otherMessage);
		
		setTimeout(function(){
			// display the found files and their category
			libInstance
				.allFilesWithCategory
				.forEach(function(value,key){
					console.log(key + " : " + value);
				});
		}, 1000);
	})
	.catch( (err) => {
		console.log(err.message);
	});

fileMappingDemo

Documentation

For more examples and API details, see API documentation

Test

npm test

To generate a test coverage report:

npm run coverage

Contributing

  • If you're unsure if a feature would make a good addition, you can always create an issue first.
  • We aim for 100% test coverage. Please write tests for any new functionality or changes.
  • Any API changes should be fully documented.
  • Be mindful of others when making suggestions and/or code reviewing.