# vue-methodly

> A simple Vue plugin to augment your Vue instance methods with custom ones

Latest version **0.1.9** (published 2019-07-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-methodly
pnpm add vue-methodly
yarn add vue-methodly
bun add vue-methodly
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.9 |
| Published | 2019-07-19 |
| First published | 2018-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 165 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jonathan James Cosgrove |
| Maintainers | jjcosgrove |
| Keywords | methods, hooks, lifecycle, plugin, vue, vuejs |

## Links

- npm: https://www.npmjs.com/package/vue-methodly
- Repository: https://github.com/jjcosgrove/vue-methodly
- Homepage: https://github.com/jjcosgrove/vue-methodly#readme
- Issues: https://github.com/jjcosgrove/vue-methodly/issues
- npm.io page: https://npm.io/package/vue-methodly

## Recent versions

- 0.1.9 (latest) — 2019-07-19
- 0.1.8 — 2018-10-02
- 0.1.7 — 2018-09-25
- 0.1.6 — 2018-09-25
- 0.1.5 — 2018-09-25
- 0.1.4 — 2018-09-25
- 0.1.3 — 2018-09-08
- 0.1.2 — 2018-08-29
- 0.1.1 — 2018-08-29
- 0.1.0 — 2018-08-29
- 0.0.9 — 2018-08-29
- 0.0.8 — 2018-08-29
- 0.0.7 — 2018-08-29
- 0.0.6 — 2018-08-29
- 0.0.5 — 2018-08-29
- … 2 more at https://npm.io/package/vue-methodly/versions

## README

# Vue Methodly

A simple Vue plugin to augment your Vue instance methods with custom ones.

## Install

### NPM/Yarn

```bash
npm install vue-methodly --save
```

or

```bash
yarn add vue-methodly --save
```

### Browser

```html
<script src="https://unpkg.com/vue-methodly"></script>
```

## Usage

### Webpack

```js
import VueMethodly from 'vue-methodly'
...
Vue.use(VueMethodly, {
  methods: [
    {
      // the name of your custom method
      name: 'myCustomMethod',

      // the native hook on which to execute
      hook: 'mounted'
    },
    ...
  ]
})
...
```

```js
// some component
...
export default {
  ...
  // gets executed before the native mounted() hook
  myCustomMethod () {
    // whatever you like here
  },
  ...
}
...
```

### Browser

```js
Vue.use(VueMethodly, {
  methods: [
    {
      // the name of your custom method
      name: 'myCustomMethod',

      // the hook before which to execute
      hook: 'mounted'
    },
    ...
  ]
})
```

```js
Vue.component('MyComponent', {
  ...
  // gets executed before the native mounted() hook
  myCustomMethod () {
    // whatever you like here
  },
  ...
})
```

## Example
https://jsfiddle.net/yprbeh5f/

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