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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@aliatech/loopback-diff-mixin

v0.11.0

Published

Loopback diff mixin allows to detect and hook for specific changes in persist models

Downloads

9

Readme

Loopback Diff mixin

Build Status Coverage Status npm version

Loopback diff mixin allows to detect and hook for specific changes in persist models

Highlights

  • //TODO

IMPORTANT: This Loopback mixin has only be tested with Loopback 3 and MongoDB connector. Requires Node ≥ 8

This project is under development.

How to install

Install the package through NPM

npm i -S @aliatech/loopback-diff-mixin

Install the package through Yarn

yarn add --prod @aliatech/loopback-diff-mixin

Basic configuration

Include the mixin in server/model-config.json. Example for Loopback 3:

{
  "_meta": {
    "sources": [
      "loopback/common/models",
      "loopback/server/models",
      "../common/models",
      "./models"
    ],
    "mixins": [
      "loopback/common/mixins",
      "../node_modules/@aliatech/loopback-diff-mixin/lib",
      "../common/mixins"
    ]
  }
}

Enable the mixin in your model definition, ie person.json.

{
  "name": "Person",
  "properties": {
    "name": "string"
  },
  "mixins": {
    "Diff": {
      "hooks": {
        "email": "emailChanged"
      }
    }
  }
}

Usage

//TODO

Debug

Prepend DEBUG environment when running server or tests to display what is happening:

DEBUG=loopback:mixins:diff node . # Run server with debug

Testing

Install develop dependences

npm i -D # If you use NPM
yarn install # If you use Yarn

Execute tests

npm test # Without coverage check
npm run test-with-coverage # With coverage check
DEBUG=loopback:mixins:diff npm test # With debug

Credits

Developed by Juan Costa for ALIA Technologies