backup-state

0.0.3 • Public • Published

Backup State

Easily create backup and restore buttons.

Installation

npm i backup-state

Backup

<script setup="">
  import {backup} from 'backup-state'

  const data = {
    name: 'Zen',
    location: 'Indonesia'
  }
</script>

<template>
  <button @click='backup(data, "data.txt")'>backup</button>
</template>

Restore

<script setup="">
  import {restore} from 'backup-state'
  import {ref} from 'vue'
  
  const data = ref({})

  async function getNow(){
    data.value = await restore()
  }
</script>

<template>
  <button @click='getNow'>restore</button>
</template>

Readme

Keywords

Package Sidebar

Install

npm i backup-state

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

12.1 kB

Total Files

19

Last publish

Collaborators

  • mzaini30