Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kesarion committed Sep 22, 2018
1 parent 3cee892 commit 04136a4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,48 @@
# letsenhance
Command line client for letsenhance.io - Enhance images in a directory

## Usage:

#### Command line
`letsenhance [options] email password /path/source /path/dest`


#### Node
```
const Enhancer = require('letsenhance');
async function enhance() {
const enhancer = new Enhancer(options);
let err = await enhancer.login(email, password);
if (err) {
return console.log('Login failed.');
}
err = await enhancer.enhanceDir(sourcePath, destPath);
if (err) {
return console.log(`Error while processing: ${err}`);
}
console.log('Processing complete!');
}
enhance();
```

### Options:
**`--type`** string - `JPEG` (default) or `PNG`; PNG yields a larger file that maintains its quality across any subsequent alterations (jpeg does not);
**`--version`** string - `magic` (default, for photographs), `boring` (for everything else), `color-enhance`, `tone-enhance`;
**`--mode`** string - `Auto` (default); Auto is the only supported transformation mode at the moment;
**`--maxParallel`** number - 10 (default); how many files to process at a time; use a lower value if you encounter frequent issues;
**`--attempts`** number - 6 (default); how many times to re-attempt an operation after a 'soft' failure; the default value should suffice;
**`--progressInterval`** number - 15 (default); how many seconds to wait before checking a file's progress; use a greater value if an error message suggests it (e.g. 30 or higher);
**`--stopOnFirstFailedFile`** boolean - `true` (default) or `false`; stop the entire process on a 'hard' failure (used to prevent wasting available transformations);

#### Example with options:
`letsenhance --type PNG --version boring --maxParallel 8 --progressInterval 30 [email protected] joespassword /path/source /path/dest`

## Notes:
Options must be placed before the email string.
If the paths or password contain spaces, use quotes: '/path to a dir' or "/path to another dir".
Make sure there are only images in the source path directory; other files will cause errors and eventually halt the process. Hidden files starting with '.' are ignored.
Don't use an option without a value, it may lead to unexpected results.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "letsenhance",
"version": "0.1.0",
"version": "0.1.1",
"description": "Command line client for letsenhance.io - Enhance images in a directory",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit 04136a4

Please sign in to comment.