Giter Site home page Giter Site logo

strange.js's Introduction


Strange.js

is a powerful library that simplifies interaction with Strange API, making image manipulation easier.

Written in TypeScript

Useful links

Documentations: TBD
Support Server: join

Usage

Important

Before we begin, you should have your Strange API key saved somewhere securely. If you don't have a key yet, please get it from here or by joining Strange Support Server.

Examples:

CommonJS:

const {StrangeImage} = require("strange.js");
const fs = require("fs");

(async () => {
    const strange = new StrangeImage("strange-api-token"); // replace your token here

    const buffer = await strange.filters.blur("image-url", 6);

    fs.writeFileSync("blurry-image.png", buffer); // saved the buffer as a png file to disk
})();

EJS and TypeScript:

import StrangeImage from "strange.js"; // can be imported by default

const fs = require("fs");

(async () => {
    const strange = new StrangeImage("strange-api-token"); // replace your token here

    const buffer = await strange.filters.blur("image-url", 6);

    fs.writeFileSync("blurry-image.png", buffer); // saved the buffer as a png file to disk
})();

Using Sub classes:

import {StrangeFilters, StrangeGenerators, StrangeOverlays, StrangeUtils} from "strange.js"; // for EJS and TS users
const {StrangeFilters, StrangeGenerators, StrangeOverlays, StrangeUtils} = require("strange-js"); // for Common.js users

const fs = require("fs");

(async () => {
    const filters = new StrangeFilters("strange-api-token"); // replace your token here
    const overlays = new StrangeOverlays("strange-api-token"); // replace your token here

    const buffer1 = await filters.blur("image-url", 6);
    const buffer2 = await overlays.toBeContinued("image-url");

    fs.writeFileSync("blurry-image.png", buffer1); // saved the buffer as a png file to disk
    fs.writeFileSync("tobecontinued-image.png", buffer2); // saved the buffer as a png file to disk
})();

strange.js's People

Contributors

imnaiyar avatar rhaym-tech avatar

Watchers

 avatar

Forkers

imnaiyar aikoonee

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.