alioss-image-hosting
v1.0.2
Published
Use aliyun oss like a image hosting.
Downloads
2
Readme
Aliyun OSS image hosting
A tool for uploading image from clipboard to aliyun oss service and save image url to clipboard.
Requirements
- MACOS
- nodejs >= 8.0.0
- pngpaste
brew install pngpaste
- Aliyun OSS account
Install
npm install alioss-image-hosting -g
Usage
- configure
You just need to initialize configuration once, unless you want to change your aliyun oss identities.
~ ossih-config
~ ossih-config
? Input aliyun oss AccessKeyId: your_access_key_id
? Input aliyun oss AccessKeySecret: your_access_key_secret
? Choose a region: your_regin
? Choose a bucket to save images: your_bucket_name
? Choose image url output format: url
config saved:
{
"oss": {
"accessKeyId": "your_access_key_id",
"accessKeySecret": "your_access_key_secret",
"region": "your_region",
"bucket": "your_bucket_name"
},
"temp": "temp_dir",
"output": "url"
}
- upload
Make sure you have taken screen shoot and save the image data to clipboard via a screenshoot tool, then run command
~ ossih-upload
Save clipboard content as image: /your/tmp/folder/2019_1_16_2_7_13.png
Execute cmd: pngpaste /your/tmp/folder/2019_1_16_2_7_13.png
upload file /your/tmp/folder/2019_1_16_2_7_13.png aliyun oss
upload success
copy image url to clipboard success
The image url will replace the image data on clipboard, just paste it to wherever you like.The output format will be url/markdown as you configured.
Alfred Workflow
Available keywork is ih
, which means image hosting. When keyword matches, ossih-upload
will run in background, then you will get the image url on clipborad.
License
MIT