https://github.com/eldoy/dugg
Upload, download, convert and analyze files toolkit for NodeJS.
https://github.com/eldoy/dugg
Last synced: about 1 month ago
JSON representation
Upload, download, convert and analyze files toolkit for NodeJS.
- Host: GitHub
- URL: https://github.com/eldoy/dugg
- Owner: eldoy
- License: mit
- Created: 2018-09-24T23:08:43.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-08-31T01:57:15.000Z (almost 2 years ago)
- Last Synced: 2025-11-02T10:05:38.164Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 660 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dugg file sending and manipulation
Upload, download, convert and analyze files toolkit for NodeJS.
### INSTALLATION
```npm i dugg```
### USAGE
On your Node.js server:
```javascript
/**
* Setup. Showing default options
*/
var dugg = require('dugg')({
key: 'amazon_key',
secret: 'amazon_secret',
bucket: 'amazon_bucket'
})
// Example file structure
// Get this from a file upload in the browser or from your hard drive
var files = [{
size: 165888,
path: 'filepath',
name: 'filename',
type: 'image/png',
lastModifiedDate: new Date('2019-07-31T08:00:19.944Z')
}]
/**
* Upload file
*/
var urls = await dugg.upload(files)
/**
* Download file
*/
var result = await dugg.download('http://url-to/your-file.jpg')
/**
* Convert file
*/
// Jimp options, use 'auto' for Jimp.AUTO
var config = {
resize: [120, 120],
greyscale: []
}
await dugg.convert(files, config)
/**
* Get file info
* Needs exiftool installed
*/
var info = dugg.info('path')
```
Enjoy! MIT Licensed.