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

ddl-tools-plugin-cart

v0.0.3

Published

Cart plugin for ddl-tools, a digital data layer helper utility with data layer schema validation for highly-decoupled analytics reporting

Downloads

9

Readme

ddl-tools-plugin-cart

Cart plugin for ddl-tools, a digital data layer helper utility with data layer schema validation for highly-decoupled analytics reporting.

Installation

Via yarn:

yarn add ddl-tools-plugin-cart

Via npm

npm install --save ddl-tools-plugin-cart

Usage

To use this plugin, you will need to instantiate DDLTools like you would typically do. You will also need to import this plugin, and call the use method to load the plugin into the DDLTools instance.

For example:

import DDLTools from 'ddl-tools';
import DDLValidator from 'ddl-validator';
import cartPlugin from 'ddl-tools-plugin-cart';
import schema from './path/to/mySchema';

const ddlValidator = new DDLValidator(schema);
const ddlTools = new DDLTools(window.digitalData, ddlValidator);
ddlTools.use(cartPlugin);

Once loaded, additional methods will be present on the DDLTools instance. For example:

ddlTools.setCartId(cartId);

See the Technical Documentation for more detailed information on what methods are added by this plugin.

Technical Documentation

Local Installation

These steps are not necessary (nor useful) for normal use. These steps are only necessary to view the source or run tests.

To install locally, clone this repository, install dependencies, and build it.

git clone https://github.com/dash-/mono-ddl-tools.git
cd mono-ddl-tools/packages/ddl-tools-plugin-cart
yarn install
npm run build

Tests

To run the unit tests, you must have this package installed locally.

Once you have this package installed locally, from the package's base directory, run npm run test.

ddl-tools-plugin-cart $ npm run test

> [email protected] pretest mono-ddl-tools/packages/ddl-tools-plugin-cart
> npm run -s lint

Lint finished...


> [email protected] test mono-ddl-tools/packages/ddl-tools-plugin-cart
> jasmine test/specs/**/*Spec.js

Started
.......


7 specs, 0 failures
Finished in 0.018 seconds

Contribute

The easiest way to contribute is to submit issues on GitHub. We welcome feedback and deeply appreciate your contribution of an issue for:

  • Improvement ideas
  • Feature requests
  • Bugs

Of course, code contributions are welcome as well!

To contribute code to this project, first fork the monorepo in GitHub, create a feature or bug branch, and commit code to the branch. You can then create a PR against the main repository. More information can be found on this topic in Rob Allen's guide: