Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-base64

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-base64

Predicate that returns true if base64 string.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
454K
decreased by-27.95%
Maintainers
1
Weekly downloads
 
Created

What is is-base64?

The is-base64 npm package is a utility for checking if a given string is a valid Base64 encoded string. It provides simple and straightforward methods to validate Base64 strings, making it useful for applications that need to handle or verify Base64 encoded data.

What are is-base64's main functionalities?

Validation of Base64 Strings

This feature allows you to check if a given string is a valid Base64 encoded string. The function returns true if the string is valid Base64 and false otherwise.

const isBase64 = require('is-base64');

const validBase64 = 'SGVsbG8gd29ybGQ=';
const invalidBase64 = 'Hello world';

console.log(isBase64(validBase64)); // true
console.log(isBase64(invalidBase64)); // false

Validation with Options

This feature allows you to validate Base64 strings with additional options. For example, you can specify whether to allow empty strings as valid Base64.

const isBase64 = require('is-base64');

const validBase64 = 'SGVsbG8gd29ybGQ=';
const invalidBase64 = 'Hello world';

console.log(isBase64(validBase64, { allowEmpty: false })); // true
console.log(isBase64('', { allowEmpty: false })); // false

Other packages similar to is-base64

Keywords

FAQs

Package last updated on 04 Mar 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc