npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@lassehaslev/restful-vue

v0.1.5

Published

Helpers for showing, update and delete elements

Downloads

4

Readme

@lassehaslev/restful-vue

Helpers for showing, update and delete elements

Install

Run npm install @lassehaslev/restful-vue --save in your project folder

This class contains mixins for making the use of restful apis easier.

We help you to add new items, update items and remove them from index with simple steps.

Usage

To get any of the mixins just get what you want from the @lassehaslev/restful-vue

import Vue from 'vue'

// Install plugin and dependencies
import RestfulVue from '@lassehaslev/restful-vue';
Vue.use( RestfulVue );

// Import everything
import { container, create, update, remove } from '@lassehaslev/restful-vue'

// If you only want the container
import { container } from '@lassehaslev/restful-vue'

Container

The container mixin is to handle list of items and index. This is also where we add newly created models, and remove them on delete.

The container is also the home of the objects that uses the Create mixin and Edit mixin.

<template>
    <update v-for="model in models" :url="'/api/update/' + model.id" :model="model"></update>
    <create url="/api/store"></create>
</template>
<script>
    import { container } from '@lassehaslev/restful-vue'
    module.exports = {

        mixins: [ container ],

        components: {
            Create,
            Edit,
        }

    }
</script>

Create

Create is the mixin thats create an elements an push it in to the container

<template>
    <button @click="create" class="add">Create</button>
</template>
<script>
    import { create } from '@lassehaslev/restful-vue'
    module.exports = {
        mixins: [ create ],
    }
</script>

Update and Delete

The update mixin is for updating items. When updated the new items goes into the container index list.

The Delete sends out that the item should be deleted and it gets removed from the container.

<template>
    <div>
        <form @submit="update">
            <input id="" type="text" v-model="model.name">
            <button type="submit">Update</button>
        </form>
        <span @click="delete">X</span>
    </div>
</template>
<script>
    import { update, remove } from '@lassehaslev/restful-vue'
    module.exports = {
        mixins: [ update, remove ],
    }
</script>

Development

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev