https://github.com/shimohq/js-type-convert
convert js many types without stackoverflow!
https://github.com/shimohq/js-type-convert
Last synced: 6 months ago
JSON representation
convert js many types without stackoverflow!
- Host: GitHub
- URL: https://github.com/shimohq/js-type-convert
- Owner: shimohq
- License: gpl-3.0
- Created: 2017-03-06T08:50:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-06T13:33:54.000Z (over 8 years ago)
- Last Synced: 2024-04-29T05:03:15.657Z (over 1 year ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 2
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# js-type-convert
convert js many types without stackoverflow!##Install
`npm install --save js-type-convert`##Uasge
The babel is the es5 file.If you want to use es6,please index.js.**notice**: this model only can be used in browser.
``
###Base64 to JS File
eg.
```js
var base64Data = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==';
var contentType = 'image/png';var testFile = jsTypeConvert.base64ToFile(base64Data, {
contentType,
fileName: 'biu'
});
// File {name: "biu", lastModified: 1488800879049, lastModifiedDate: Mon Mar 06 2017 19:47:59 GMT+0800 (CST), ...}
```