Socket
Book a DemoInstallSign in
Socket

@eternaljs/base64-info

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eternaljs/base64-info

Enhance base64 workflows. Swiftly retrieve type, extension, and content info. Simplify binary data management for smoother project integration.

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
4
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Base64 Info

The base64-info npm package is a lightweight and efficient utility that simplifies working with base64 encoded strings by providing convenient methods to extract crucial details. With this package, you can effortlessly determine the type, extension, and content of base64 strings, making it an essential tool for developers dealing with binary data conversions.

Key Features:

  • Type Detection: Easily identify the type of data represented by a base64 string, whether it's an image, audio, video, or other file formats.

  • Extension Inference: Automatically infer the file extension associated with the base64 content, ensuring accurate representation when decoding or processing the data.

  • Content Extraction: Retrieve the binary content from a base64 string, enabling seamless integration with various data manipulation workflows.

  • Efficient Performance: Designed for optimal performance, base64-info provides quick and reliable results, suitable for both small and large-scale applications.

Whether you're building applications that involve image uploading, multimedia handling, or file conversion, base64-info streamlines the process of working with base64 encoded data, allowing you to focus on delivering robust and feature-rich applications.

Installing

Using npm:

$ npm install @eternaljs/base64-info

Using yarn:

$ yarn add @eternaljs/base64-info

Imports

// JavaScript
const { getBase64Info } = require("@eternaljs/base64-info");

// TypeScript
import { getBase64Info } from "@eternaljs/base64-info";

Usage

These examples assume you're in node, or something similar:

const base64Details = getBase64Info(base64String);

// Log
console.log(base64Details);

// Output
{
    "name": "JPEG",
    "type": "image/jpeg",
    "sign": "/9j/4AAQSk",
    "extension": "jpeg",
    "content": "data:image/jpeg;base64",
    "category": "image",
    "base64": "/9j/4AAQSkZJRgABAQEASABIAAD"
}

Supported files extension

jpeg, jpg, png, jfif, gif, webp, xcf, bmp, cur, dds, exr, fts, hdr, ico, jpe, jps, mng, pam, pbm, pcd, pcx, pgm, picon, pict, pnm, ppm, psd, ras, sgi, svg, tga, tiff, wbmp, xbm, xpm, xwd, erf, heic, jp2, pes, pfm, heif, swf, dng, orf, X3F, nrw, rw2, nef, pef, raf, cr2, xlsx, xls, txt, ott, odt, ods, odp, djvu, doc, csv, ppt, rtf, docx, pdf, cvsd, cvu, gsrt, hcom, m4a, mp3, ogg, opus, prc, sln, spx, txw, vms, wve, cvs, dvms, m4r, wma, ima, ra, vox, aac, sndr, sndt, ac3, 8svx, fssd, htk, smp, sou, aiff, flac, oga, tta, wv, sd2, amb, au, avr, caf, cdda, dts, fap, ircam, maud, nist, paf, pvf, snd, sph, voc, w64, wav, bat, htaccess, json, kml, sql, c, cpp, cs, css, go, h, java, pl, py, rb, sh, html, html, swift, test, vb, yaml, class, js, snb, pdb, mobi, lrf, fb2, epub, azw3, woff, ttf, sfd, ps, pfb, otf, bin, dfont, cff

License

MIT

Keywords

base64

FAQs

Package last updated on 01 Feb 2024

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.