Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

imgbb-uploader

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imgbb-uploader - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

CHANGELOG.md

55

package.json
{
"name": "imgbb-uploader",
"version": "1.0.3",
"version": "1.1.0",
"description": "Lightweight module to upload images through Imgbb API.",
"main": "index.js",
"main": "lib/cjs/index.js",
"browser": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"types": "lib/index.d.ts",
"dependencies": {
"fs": "0.0.1-security",
"request": "^2.88.0"
"fs": "0.0.1-security"
},
"devDependencies": {},
"scripts": {
"test": "npx standard"
"test": "jest --config jestconfig.json",
"build": "node rebuild.js && tsc -p tsconfig-cjs.json",
"build:cjs": "node rebuild.js && tsc -p tsconfig-cjs.json",
"build:esm": "node rebuild.js && tsc -p tsconfig.json",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
"lint": "tslint -p tsconfig.json",
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags",
"pretty-quick": "pretty-quick"
},
"files": [
"lib/**/*"
],
"devDependencies": {
"@babel/types": "^7.11.0",
"@types/dotenv": "^8.2.0",
"@types/jest": "^26.0.9",
"@types/node": "^14.0.27",
"dotenv": "^8.2.0",
"eslint-plugin-import": "^2.22.0",
"husky": "^4.2.5",
"jest": "^26.4.0",
"prettier": "^2.0.5",
"pretty-quick": "^2.0.1",
"rimraf": "^3.0.2",
"ts-jest": "^26.2.0",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.9.7"
},
"repository": {

@@ -20,3 +52,5 @@ "type": "git",

"imgbb",
"imgbb-uploader"
"imgbb-uploader",
"image upload",
"picture upload"
],

@@ -28,3 +62,8 @@ "author": "TheRealBarenziah",

},
"homepage": "https://github.com/TheRealBarenziah/imgbb-uploader#readme"
"homepage": "https://github.com/TheRealBarenziah/imgbb-uploader#readme",
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
}

35

README.md
# imgbb-uploader
Lightweight Nodejs module to upload local pictures files to imgbb API and get display URLs in response.
Lightweight Nodejs module to upload local pictures files to imgbb API and get display URLs in response.
Primary use is letting imgBB handle the hosting & serving of images.
[![https://nodei.co/npm/imgbb-uploader.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/imgbb-uploader.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/imgbb-uploader)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Known Vulnerabilities](https://snyk.io/test/github/TheRealBarenziah/imgbb-uploader/badge.svg?targetFile=package.json)](https://snyk.io/test/github/TheRealBarenziah/imgbb-uploader?targetFile=package.json)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Build Status](https://travis-ci.org/TheRealBarenziah/imgbb-uploader.svg?branch=master)](https://travis-ci.org/TheRealBarenziah/imgbb-uploader)
## Compatibility:
## Compatibility:
**Node >= 8** ( [this module uses async/await](https://node.green/) )
*Care: this module uses `fs` under the hood. It means it WON'T work outside the node environment !*
*To upload pictures from your frontend please check the [File API](https://developer.mozilla.org/en-US/docs/Web/API/File) instead*
_Care: this module uses `fs` under the hood. It means **it WON'T work outside the node environment !**_
_To upload pictures from your frontend please check the [File API](https://developer.mozilla.org/en-US/docs/Web/API/File) instead_
## Install
`npm install imgbb-uploader`
## Use
- I) [Get a free API key from imgbb](https://api.imgbb.com/) ( estimated time : ~1 minute )
- I) [Get a free API key from imgbb](https://api.imgbb.com/) ( estimated time ~1 minute )
- II) (facultative) [Put that in an environment variable](https://www.npmjs.com/package/dotenv)
- III) **imgbbUploader takes *exactly two* String arguments** : your API key, and the absolute path of your image :
- III) **imgbbUploader takes _exactly two_ String arguments** : your API key, and the absolute path of your image :

@@ -30,2 +36,3 @@ ```

## `.then(response => console.log(response))` output example :
```

@@ -63,8 +70,11 @@ {

**This module is ~20 lines long & totally unlicensed: to better fit your need, feel free to edit !**
**This module is tiny & totally unlicensed: to better fit your need, feel free to fork !**
[Basic instructions for tweaking](https://github.com/TheRealBarenziah/imgbb-uploader/blob/master/CONTRIBUTING.md)
## Learn more
This module doesn't support array uploads. For heavy duty, you'll probably have to work with [fs.readdir](https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback) and [async forEach](https://www.npmjs.com/package/async-foreach) (you may also be interested in [path](https://nodejs.org/api/path.html#path_path) ).
This module doesn't support array uploads. For heavy duty, you'll probably have to work with [fs.readdir](https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback) and [async forEach](https://www.npmjs.com/package/async-foreach) (you may also be interested in [path](https://nodejs.org/api/path.html#path_path) ).
For example, you can create a `baseDir.js` file wherever it suits you:
```

@@ -76,7 +86,6 @@ // baseDir.js

```
Then you can require this file elsewhere and use something like `path.join(myDirpath, "subfolder", subsubfolder)` to dig into directories programmatically. Once there, you can f.e. `fs.readdir` and iterate `forEach` file of that directory.
See `fs` documentation and Stack Overflow for more inspiration on the matter.
See `fs` documentation and Stack Overflow for more inspiration on the matter.
## Changelog
0.2.1 => 1.0.0 (Replace `var` and `function` with proper ES6 syntax & update README)
1.0.0 => 1.0.1 (Fix README)
[CHANGELOG](https://github.com/TheRealBarenziah/imgbb-uploader/blob/master/CHANGELOG.md)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc