atob-lite

WebJar for atob-lite

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

atob-lite
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

atob-lite
WebJar for atob-lite
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/hughsk/atob-lite

Download atob-lite

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/atob-lite/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>atob-lite</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/atob-lite/
implementation 'org.webjars.npm:atob-lite:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/atob-lite/
implementation ("org.webjars.npm:atob-lite:2.0.0")
'org.webjars.npm:atob-lite:jar:2.0.0'
<dependency org="org.webjars.npm" name="atob-lite" rev="2.0.0">
  <artifact name="atob-lite" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='atob-lite', version='2.0.0')
)
libraryDependencies += "org.webjars.npm" % "atob-lite" % "2.0.0"
[org.webjars.npm/atob-lite "2.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

atob-lite

Smallest/simplest possible means of using atob with both Node and browserify.

In the browser, decoding base64 strings is done using:

var decoded = atob(encoded)

However in Node, it's done like so:

var decoded = new Buffer(encoded, 'base64').toString('utf8')

You can easily check if Buffer exists and switch between the approaches accordingly, but using Buffer anywhere in your browser source will pull in browserify's Buffer shim which is pretty hefty. This package uses the main and browser fields in its package.json to perform this check at build time and avoid pulling Buffer in unnecessarily.

Usage

NPM

decoded = atob(encoded)

Returns the decoded value of a base64-encoded string.

License

MIT. See LICENSE.md for details.

Versions

Version
2.0.0
1.0.0