# vue-small-plugin

> Some vue help global function, such as $debug, $openPDFb64, $openFile

Latest version **1.0.0** (published 2019-12-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-small-plugin
pnpm add vue-small-plugin
yarn add vue-small-plugin
bun add vue-small-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-12-23 |
| First published | 2019-12-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | codeegor |
| Maintainers | codegor |
| Keywords | vue, helper, debug, base64, open file, open file from base64 |

## Links

- npm: https://www.npmjs.com/package/vue-small-plugin
- Repository: https://github.com/codegor/vue-open-file-base64
- Homepage: https://github.com/codegor/vue-open-file-base64#readme
- Issues: https://github.com/codegor/vue-open-file-base64/issues
- npm.io page: https://npm.io/package/vue-small-plugin

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-12-23
- 0.1.5 — 2019-12-18
- 0.1.4 — 2019-12-18
- 0.1.3 — 2019-12-18
- 0.1.2 — 2019-12-18
- 0.1.1 — 2019-12-18
- 0.1.0 — 2019-12-18
- 0.0.1 — 2019-12-18

## README

# vue-small-plugin

> Plugin helper for Vue.js for work with base64 source data

<p>
  <a href="https://www.npmjs.com/package/vue-small-plugin"><img src="https://img.shields.io/npm/dm/vue-small-plugin.svg" alt="Downloads"></a>
  <a href="https://www.npmjs.com/package/vue-small-plugin"><img src="https://img.shields.io/npm/v/vue-small-plugin.svg" alt="Version"></a>
  <a href="https://www.npmjs.com/package/vue-small-plugin"><img src="https://img.shields.io/npm/l/vue-small-plugin.svg" alt="License"></a>
</p>

## Installation

### Using yarn

`yarn add vue-small-plugin`

### Using npm

`npm i --save vue-small-plugin`

## Examples

```html
<template>

</template>

<script>
import Vue from 'vue';
import SmallPlugin from 'vue-small-plugin';

Vue.use(SmallPlugin);

export default {
data () {
 return {
   file: {
     data: '' // base64 string
     mime: '' // file mime type
   },
   pdf: '' // base64 string
   xls: '' // url string to source of file
 }
},
computed: {
 getImgSrc () {
   return this.$imgSrcB64(this.file);
 },
 getPdfSrc () {
   return this.$aSrcPDFb64(this.file.data);
 },
},
methods: {
 doSomethingWithDebugInfo(){
   if(this.$debug) console.log('show some debug info...');
 },
 savePdf(){
   this.$savePDFb64(this.pdf, 'the_name_of_pdf.pdf'); // open in new window
 },
 openExls(){
   this.$openFile(this.xls); // open in new window
 }
}
}
</script>
```

## Global Properties

| Name            | Type     | Info                                                            |
| ----------------| -------- | --------------------------------------------------------------- |
| **$debug**      | Boolean  | Short hand for Vue debug status var                             |
| **$imgSrcB64**  | Function | Convert from Base64 img data to src string for img:src property |
| **$aSrcPDFb64** | Function | Convert from Base64 pdf data to src string for a:href property  |
| **$savePDFb64** | Function | Save PDF file from Base64 data at new Browser window            |
| **$openFile**   | Function | Open any files from url at new window of Browser                |

## Suggest

For upload files with base64 encoding you can use package satellite [v-upload-base64](https://www.npmjs.com/package/v-upload-base64)

## License

This project is licensed under
[MIT License](http://en.wikipedia.org/wiki/MIT_License)

---
_Source: https://npm.io/package/vue-small-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
