# image-bin

> This project was bootstrapped with [Create Blocklet](https://github.com/blocklet/create-blocklet).

Latest version **0.10.77** (published 2024-02-07) · 0 weekly downloads

## Install

```sh
npm install image-bin
pnpm add image-bin
yarn add image-bin
bun add image-bin
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.77 |
| Published | 2024-02-07 |
| First published | 2023-09-04 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 23 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 (+13 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | wangshijun |

## Links

- npm: https://www.npmjs.com/package/image-bin
- npm.io page: https://npm.io/package/image-bin

## Dependencies (23)

- [cors](https://npm.io/package/cors.md) ^2.8.5
- [sharp](https://npm.io/package/sharp.md) ^0.32.6
- [multer](https://npm.io/package/multer.md) 1.4.5-lts.1
- [nanoid](https://npm.io/package/nanoid.md) ^3.3.7
- [xbytes](https://npm.io/package/xbytes.md) ^1.8.0
- [express](https://npm.io/package/express.md) ^4.18.2
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.2.0
- [url-join](https://npm.io/package/url-join.md) ^4.0.1
- [mime-types](https://npm.io/package/mime-types.md) ^2.1.35
- [compression](https://npm.io/package/compression.md) ^1.7.4
- [dotenv-flow](https://npm.io/package/dotenv-flow.md) ^3.3.0
- [react-player](https://npm.io/package/react-player.md) ^2.14.1
- [serve-static](https://npm.io/package/serve-static.md) ^1.15.0
- [@arcblock/did](https://npm.io/package/@arcblock/did.md) ^1.18.110
- [@blocklet/sdk](https://npm.io/package/@blocklet/sdk.md) 1.16.21-beta-445a8baa
- [@mui/material](https://npm.io/package/@mui/material.md) ^5.15.7
- [cookie-parser](https://npm.io/package/cookie-parser.md) ^1.4.6
- [@blocklet/embed](https://npm.io/package/@blocklet/embed.md) ^0.1.5
- [@blocklet/logger](https://npm.io/package/@blocklet/logger.md) 1.16.21-beta-445a8baa
- [@blocklet/constant](https://npm.io/package/@blocklet/constant.md) 1.16.21-beta-445a8baa
- [@blocklet/uploader](https://npm.io/package/@blocklet/uploader.md) ^0.0.72
- [@mui/icons-material](https://npm.io/package/@mui/icons-material.md) ^5.15.8
- [express-async-errors](https://npm.io/package/express-async-errors.md) ^3.1.1

## Recent versions

- 0.10.77 (latest) — 2024-02-07
- 0.10.76 — 2024-02-03
- 0.10.75 — 2024-02-03
- 0.10.74 — 2024-01-29
- 0.10.73 — 2024-01-25
- 0.10.72 — 2024-01-24
- 0.10.71 — 2024-01-18
- 0.10.66 — 2024-01-09
- 0.10.65 — 2024-01-09
- 0.10.64 — 2024-01-05
- 0.10.63 — 2024-01-05
- 0.10.62 — 2024-01-05
- 0.10.61 — 2024-01-03
- 0.10.60 — 2023-12-29
- 0.10.59 — 2023-12-29
- … 47 more at https://npm.io/package/image-bin/versions

## README

# Getting Started with Create Blocklet

This project was bootstrapped with [Create Blocklet](https://github.com/blocklet/create-blocklet).

This blocklet is a dapp project, which means this is a full-stack application. It's contained both `server` and `client` code.

## File Structure

- public/ - static files
  - favicon.ico - favicon
  - favicon.svg - favicon
  - index.html - main html file, template for react
- screenshots/ - Screenshots
- api/ - Api side code
  - hooks/ - blocklet lifecycle hooks
  - libs/ - Api side libraries
  - middlewares/ - Api side middlewares
  - routes/ - Api side routes
  - index.js - Api side entry point
- src/ - Client side code (A standard react app structure)
- .env - Environment variables
- .env.local - Local environment variables
- .eslintrc.js - ESLint configuration
- .gitignore - Git ignore file
- .prettierrc - Prettier configuration
- blocklet.md - Blocklet README
- blocklet.yml - Blocklet configuration
- LICENSE - License file
- logo.png - Blocklet logo file
- Makefile - Makefile
- package.json - Npm package file
- README.md - A guide for this blocklet
- version - Version file

## Development

1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed

   Blocklet needs blocklet server as a dependency. So you need to install it first.  
   `npm install -g @blocklet/cli`  
   See details in [https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#use-the-binary-distribution](https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#use-the-binary-distribution)

2. Init blocklet server & start blocklet server

   Before starting an blocklet server, you need to init blocklet server.  
   `blocklet server init --mode=debug`  
   `blocklet server start`  
   See details in [https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#configure-abt-node](https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#configure-abt-node)

3. Go to the project directory `cd [name]`
4. Install dependencies: `pnpm install`
5. Start development server: `blocklet dev`

## Bundle

After developing a blocklet, you may need to bundle it. Use `npm run bundle` command.

## Deploy

- If you want to deploy this blocklet to local blocklet server, you can use `blocklet deploy .blocklet/bundle` command(Make sure the blocklet is bundled before deployment).
  > Or you can simply use `npm run deploy` command.
- If you want to deploy this blocklet to remote blocklet server, you can use the command below.

  ```shell
  blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret}
  ```

  > Make sure the blocklet is bundled before deployment.

## Upload to blocklet store

- If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions.

  Bump version at first.

  ```shell
  make bump-version
  ```

  Then config blocklet store url.
  You can use those store url in below.

  1. [https://store.blocklet.dev/](https://store.blocklet.dev/)
  2. [https://dev.store.blocklet.dev/](https://dev.store.blocklet.dev/)
  3. A blocklet store started by yourself.
     > Make sure you have installed a `blocklet store` on your own blocklet server. Check it on here: [https://store.blocklet.dev/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ](https://store.blocklet.dev/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ)

  ```shell
  blocklet config set store {store url}
  ```

  Get a `accessToken` by using this command.

  > Why we need a `accessToken`?  
  > A `accessToken` is genrate by blocklet store, which help us upload our blocklet to any store.

  Set `accessToken` to blocklet config

  ```shell
  blocklet config set accessToken {accessToken}
  ```

  Upload a new version to a store.

  > Make sure the blocklet is bundled before upload.

  ```shell
  blocklet upload
  ```

  Or you can simply use `npm run upload` command.

- You also can upload a new version to a store by Github CI.  
  Bump version at first.

  ```shell
  make bump-version
  ```

  Push your code to Github main/master branch, or make a pull request to the main/master branch.  
  The CI workflow will automatically upload a new version to a store.

## Q & A

1. Q: How to change a blocklet's name?

   A: Change the `name` field in the `package.json` file, change the `name` field in the `blocklet.yml` file.

   You can also change the `title` field and `description` field in the `blocklet.yml` file.

   Run `blocklet meta` command, you will get a `did` config, copy the `did` value.

   Replace this command `"bundle:client": "PUBLIC_URL='/.blocklet/proxy/{did}' npm run build",` in `package.json`

   Replace `did` field in the `blocklet.yml`

2. Q: How to change a blocklet's logo?

   Change the `logo.png` file root folder.

   Or you can change the `logo` field in the `blocklet.yml` file.

   > Make sure you have added the logo path to the `blocklet.yml` file `files` field.

## Learn More

- Full specification of `blocklet.yml`: [https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md](https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md)
- Full document of Blocklet Server & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)

## License

The code is licensed under the Apache 2.0 license found in the
[LICENSE](LICENSE) file.

---
_Source: https://npm.io/package/image-bin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
