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

dcconcurrencymanager

v1.0.2

Published

Module for outputing change log dcData data and concurrency management system

Downloads

5

Readme

dc.ConcurrencyManager

Module for managing concurrency and outputting history.

Installing:

Clone the Repo

  git clone [email protected]:TRLX/dc.ConcurrencyManager.git 

Install modules

  npm install 

Run the module

  npm start 

Module will compare mock meeting data from ./testData folder. Folder consist of current and incoming folders which imitates user 1 ( dc.App ) and user 2 ( CRM ).

Usage:

accepts @current, @incomming and @include as parameters.

@current - Record to which changes should be compared. @incomming - Record of incomming changes @include - A field name which will be included in all output of changeds, regarding whether it has been changed or not e.g Id which is needed to identify repeater items.

Example output of diff process for Simple Cards:

// Compares two data set of simple cards and outputs updates as JSON object.
api.getSimpleCardDiff(current, head, 'id')

Output:

[ 
  { title: 'Mrs',
    fullName: 'Dito',
    homeAddress:
     { BuildingName: 'Dremm Town',
       Line1: '',
       CountryName: 'Kololand hohlandia' },
    currentValueOfTheProperty: { amountGBP: 2500000 } },
  { areYouASmoker: 'no',
    sufferingFromAnyMedicalConditions: 'no',
    sufferingFromAnyMedicalConditionsPleaseProvideDetails: ''},
  { areYouAUkTaxPayer: 'yes',
    pleaseGiveUsDetails: '',
    areYouDomiciliedInTheUK: 'no',
    countryOfResidence: 'Germany',
    whenDidYourUKResidencyBegin: '16 June 2009',
    isYourTaxStatusExpectedToChange: 'yes',
    isYourTaxStatusExpectedToChangeDetails: 'Mjhgfd' },
  {},
  {} 
 ]

Example output of diff process for Repeaterter Cards:

// Compares two data set of repeater cards and outputs updates as array JSON object, containing changed, deleted or created value with ID included.

api.getSimpleCardDiff(current, incomming, 'id')

OUTPUT:

[ { id: '1', __status: 'updated', nameOfTheCompany: 'Cvb' },
  undefined,
  undefined,
  { id: 'B1apGgV1H',
    __status: 'updated',
    amount:
     { amount: [Object], undefined: undefined, __status: 'updated' } },
  { id: 'SyPCMeNkH', __status: 'deleted' },
  { id: 'BkKkXgEJB', __status: 'deleted' },
  { id: 'BkqTFkV1H',
    __status: 'updated',
    policyAccountNumber: 'SAN36123728',
    repaymentMethod: 'Test Method',
    earlyRepaymentCharges: 'No' },
  { id: 'BJx0-XlN1S', __status: 'deleted' },
  { id: 'S1lqM7xEyH', __status: 'deleted' },
  { id: 'ryj2tkVyH', __status: 'deleted' } ]

__status describes the actions on field or repeater item In case when item is deleted from repeater, module will output:

id: 'BJx0-XlN1S'
__status: 'deleted'

Use the id to hook the record for full info in History UI.

In case of update value in the output will be

  { id: 'BkqTFkV1H',
    __status: 'updated',
    policyAccountNumber: 'SAN36123728',
    repaymentMethod: 'Test Method',
    earlyRepaymentCharges: 'No' }

Showing the ID of the repeater item ( for hooking and pulling any edditional information ) and ONLY the fields which has been modified.

Unit Testing

Module testing is done via Mocha and Chai. Each test is contained in tests folder, devided by simple and repeater cards.

Running tests

To Run test use npm with following command.

npm test

Currently there are:

  • Simple card tests
  • Repeater card tests
  • Utility testing

Next steps:

  • Output Changes as history
  • Implement tests for:
  1. Empty Records diff.
  2. Identical Records diff.
  3. Break down tests by cards.

Blocker Need clarificataion for following:

  1. what should output be if repeater item is deleted.
  2. what should output be if repeater item is created.