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

@abtasty/widget-utils

v1.18.38

Published

Collection of useful functions for AB Tasty Widgets.

Downloads

742

Readme

Widgets Utils

Collection of useful functions for AB Tasty Widgets.

Installation

Inside your Widget folder, install the widget-utils library:

npm install @abtasty/widget-utils

Note: you can also use yarn instead of npm: yarn add @abtasty/widget-utils

Usage

With Webpack or Rollup.js:

import { waitForElement, isAffected } from '@abtasty/widget-utils';

const waitForBody = waitForElement('#section', (section) => {
	section.insertAdjacentHTML('beforeend', '<p>New paragraph at the end of that section.</p>');
});

setTimeout(() => {
	if (!isAffected()) {
		waitForBody.clear();
	}
}, 10000);

Link this local project to a local widget project

Using NPM Link (recommended)

When you have installed and build your locally project :

  1. run in a terminal : npm link in your widget-utils folder
  2. in your widget local folder you want to test this project, run in a terminal : npm link @abtasty/widget-utils
  3. build your widget project, then build editor project.

Using symlink

First, install your widget-utils, copy the path of the project. Then, In your local widget project :

  • after a npm install, delete the folder /node_modules/@abtasty/widget-utils
  • with your terminal, navigate to the folder /node_modules/@abtasty/
  • run the bash command :
ln -s {your path to widget-utils project folder} widget-utils

A symlink has been created in your widget project, with the folder: /node_modules/@abtasty/widget-utils

Development

Generating fonts.js File

The fonts.js file in this repo is exposing the Google Fonts from ABTasty CDN (which is populated by this repo: https://gitlab.com/abtasty/turfu/common-fonts)

Any changes in the common-fonts repo must follow the font regeneration here.

To regenerate the fonts.js file,

  • run the following command in the root of this repo:
yarn run generateFonts
  • And commit the file
  • Create the merge request
  • Seek at least one approval from fellow frontend developers or nautilus team
  • Merge the MR

Releasing this repo

Once the MR is approved, follow the following steps:

  • Release this repo on npm with npm publish
  • Merge the repo