https://github.com/sandy98/bluestar
Tiny node.js based utility to encode image files to base 64 strings suitable to be embedded in web pages
https://github.com/sandy98/bluestar
image-processing nodejs pkg
Last synced: 26 days ago
JSON representation
Tiny node.js based utility to encode image files to base 64 strings suitable to be embedded in web pages
- Host: GitHub
- URL: https://github.com/sandy98/bluestar
- Owner: sandy98
- License: mit
- Created: 2017-11-10T07:27:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-09-17T13:49:16.000Z (over 3 years ago)
- Last Synced: 2025-05-06T12:13:35.710Z (about 1 year ago)
- Topics: image-processing, nodejs, pkg
- Language: JavaScript
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bluestar
Tiny node.js based utility to convert images to base64 encoded string suitable to be embedded in web pages.
## Install
Either
```sh
git clone https://github.com/sandy98/bluestar.git
cd bluestar
npm install
npm build
```
or
```sh
sudo npm install -g bluestar
```
In the first case you get an executable version of the script: bluestar and 3 binary executables: bluestar-linux, bluestar.macos and bluestar-win.exe.
You can choose to copy your OS specific executable within a location in your path and you're done.
In the second case, npm or yarn install, you get a system wide available version of the executable script.
## Usage
This is the simplest part: just do
```sh
bluestar whatever.png
```
and get 2 files: whatever.b64 and whatever.html, which is a ready made html file to test the created image.
With version 0.1.1 onwards, you also can import/require convert function for usage in your own apps, like so:
```js
const convert = require('bluestar');
convert('photo.gif', (err, data) => {
if (err) console.error("Error No: " + err.number + " " + err.message)
else console.log(data)});
```