New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bimg

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bimg

A reverse-engineered Bing Image Creation API

latest
Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
24
200%
Maintainers
1
Weekly downloads
 
Created
Source

Bimg

NPM NPM Downloads

A npm package of reverse-engineered Bing Image Creator API. Courtesy of Bing Image Search API and EdgeGPT by acheong08.

Installation

npm install bimg

Usage

Set environment variables

Create a .env file in the root directory of your project and add the cookie of your Bing Image Search session. You need access to Bing Image Creator or a valid cookie from someone who has access.

The cookie you need from Bing is the _U cookie, this could be aquired using a chrome-extension or by using the Network tab in Chrome DevTools.

BING_IMAGE_COOKIE: <your Bing Image Search cookie>

Import the package

import { generateImageFiles, generateImagesLinks } from "bimg";

const imageLinks = await generateImagesLinks(prompt); // returns an array of 4 image links
const imageFiles = await generateImageFiles(prompt); // returns an array of 4 image files

The image file is a object of

{
  name: string,
  data: string   // base64 encoded image data from Buffer
}

Examples

See my simple expressjs server here.

Keywords

bing

FAQs

Package last updated on 10 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts