@waiting/base64
Advanced tools
Comparing version 4.2.0 to 4.2.1
@@ -5,2 +5,16 @@ # Changelog | ||
### [4.2.1](https://github.com/waitingsong/base64/compare/v4.2.0...v4.2.1) (2019-06-13) | ||
### Build System | ||
* use base64 as name of package for building ESM ([db96fe8](https://github.com/waitingsong/base64/commit/db96fe8)) | ||
### Tests | ||
* **browser:** polyfill for ie11 ([5976675](https://github.com/waitingsong/base64/commit/5976675)) | ||
## [4.2.0](https://github.com/waitingsong/base64/compare/v4.1.0...v4.2.0) (2019-06-13) | ||
@@ -7,0 +21,0 @@ |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 4.2.0 | ||
* @version 4.2.1 | ||
* @author waiting | ||
@@ -8,0 +8,0 @@ * @license MIT |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 4.2.0 | ||
* @version 4.2.1 | ||
* @author waiting | ||
@@ -8,0 +8,0 @@ * @license MIT |
{ | ||
"name": "@waiting/base64", | ||
"author": "waiting", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"description": "Base64 encoding/decoding in pure JS on both modern Browsers and Node.js. Also supports URL-safe base64", | ||
@@ -9,2 +9,4 @@ "keywords": [ | ||
"URL-safe", | ||
"atob", | ||
"btoa", | ||
"browser", | ||
@@ -25,4 +27,4 @@ "Node.js", | ||
"bin": {}, | ||
"browser": "./dist/index.esm.js", | ||
"es2015": "./dist/index.esm.js", | ||
"browser": "./dist/base64.esm.js", | ||
"es2015": "./dist/base64.esm.js", | ||
"main": "./dist/index.cjs.js", | ||
@@ -29,0 +31,0 @@ "module": "./dist/index.js", |
@@ -23,2 +23,4 @@ # Base64 | ||
[TextDecoder](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder#Browser_compatibility) | ||
- Polyfills [text-encoding](https://github.com/inexorabletash/text-encoding), | ||
[es6-shim](https://github.com/es-shims/es6-shim) for IE11 | ||
@@ -37,3 +39,3 @@ | ||
## Usage | ||
## Usage of Node.js | ||
@@ -79,2 +81,25 @@ ### Encodeing | ||
## Usage of browser | ||
### ESM | ||
```html | ||
<script type="module"> | ||
import { b64encode, b64urlEncode } from './base64.esm.min.js' | ||
console.log(b64encode('A')) // 'QQ==' | ||
console.log(b64urlEncode('A')) // 'QQ' | ||
</script> | ||
``` | ||
### UMD | ||
```html | ||
<script src="./base64.umd.min.js"></script> | ||
<script> | ||
// global variable base64 | ||
console.log(base64.b64encode('A')) | ||
console.log(base64.b64urlEncode('A')) | ||
</script> | ||
``` | ||
## Testing | ||
@@ -81,0 +106,0 @@ ```sh |
@@ -22,2 +22,4 @@ # Base64 | ||
[TextDecoder](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder#Browser_compatibility) 功能 | ||
- [text-encoding](https://github.com/inexorabletash/text-encoding), | ||
[es6-shim](https://github.com/es-shims/es6-shim) 补丁用于 IE11 | ||
@@ -35,3 +37,3 @@ | ||
## 使用 | ||
## Node.js 使用 | ||
@@ -77,2 +79,25 @@ ### 编码 | ||
## 浏览器使用 | ||
### ESM | ||
```html | ||
<script type="module"> | ||
import { b64encode, b64urlEncode } from './base64.esm.min.js' | ||
console.log(b64encode('A')) // 'QQ==' | ||
console.log(b64urlEncode('A')) // 'QQ' | ||
</script> | ||
``` | ||
### UMD | ||
```html | ||
<script src="./base64.umd.min.js"></script> | ||
<script> | ||
// 全局变量 base64 | ||
console.log(base64.b64encode('A')) | ||
console.log(base64.b64urlEncode('A')) | ||
</script> | ||
``` | ||
## 测试 | ||
@@ -79,0 +104,0 @@ ```sh |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
239376
54
3016
127
1