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

@cnbritain/merlin-frontend-article-js

v1.18.10

Published

ArticleManager, Article

Downloads

90

Readme

merlin-frontend-article-js

ArticleManager, Article

JS Documentation

Article

Kind: global class

new Article(el, options)

| Param | Type | Description | | --- | --- | --- | | el | HTMLElement | The article element | | options | Object | Article options | | options.analytics | Object | Analytics configuration for the article | | options.infinite | Boolean | Whether the article came from infinite scroll | | options.manager | ArticleManager | The article manager that added the article | | options.type | Number | The article type based on ARTICLE_TYPES enum | | options.simplereach | Object | Simplereach configuration for promotions |

article.bounds : Object

The bounds of the article element

Kind: instance property of Article
Access: public

article.el : HTMLElement

The article element

Kind: instance property of Article
Access: public

article.isInfinite : Boolean

Is the article from infinite scroll?

Kind: instance property of Article
Access: public

article.manager : ArticleManager

The article manager that added the article

Kind: instance property of Article
Access: public

article.initialiseAds()

Initialiases the ads

Kind: instance method of Article
Access: public

article.resize()

Calculates any new size changes

Kind: instance method of Article
Access: public

"focus"

When an article is the current focus on the screen

Kind: event emitted by Article

"blur"

When an article is the loses current focus on the screen

Kind: event emitted by Article

ArticleManager

Kind: global class

articleManager.articles : Array

List of articles that have been loaded

Kind: instance property of ArticleManager
Access: public

articleManager.addArticle(el, options) ⇒ Article

Adds an article to the list

Kind: instance method of ArticleManager
Emits: add
Access: public

| Param | Type | Description | | --- | --- | --- | | el | HTMLElement | The article element | | options | Object | Options for the Article | | options.infinite | Boolean | Has the article come from infinite scroll? | | options.type | Number | The article type. Based on ARTICLE_TYPES | | options.analytics | Object | Analytics config for the article | | options.simplereach | Object | SimpleReach config for promotions |

articleManager.disableInfiniteScroll()

Disables the infinite scroll

Kind: instance method of ArticleManager
Access: public

articleManager.enableInfiniteScroll()

Enables the infinite scroll

Kind: instance method of ArticleManager
Access: public

articleManager.resize(_start, _length)

Recalculates some measurements

Kind: instance method of ArticleManager
Access: public

| Param | Type | | --- | --- | | _start | Number | | _length | Number |

"add"

Adds an article to the list

Kind: event emitted by ArticleManager
Properties

| Name | Description | | --- | --- | | article | The added article |

ArticleManager.ARTICLE_TYPES : Number

Article types enum

Kind: static property of ArticleManager

Gallery

Kind: global class

new Gallery(el, options)

| Param | Type | Description | | --- | --- | --- | | el | HTMLElement | Article Element 'a-main' | | options | Object | Gallery options |

gallery.galleryBounds : Object

The bounds of the gallery container

Kind: instance property of Gallery
Access: public

gallery.items : Array.HTMLElement

Items in the gallery - images and ads

Kind: instance property of Gallery
Access: public

gallery.images : Array.HTMLElement

Images in the gallery

Kind: instance property of Gallery
Access: public

gallery.navigation : GalleryImageNavigation

The gallery navigation arrows

Kind: instance property of Gallery
Access: public

gallery.thumbnails : HTMLElement

The gallery thumbnail images

Kind: instance property of Gallery
Access: public

gallery.section : HTMLElement

The gallery section images

Kind: instance property of Gallery
Access: public

gallery.resize()

Resize calculates new bounds

Kind: instance method of Gallery
Access: public

gallery.hideListView()

Hides list view and shows thumbnail view

Kind: instance method of Gallery
Access: public

gallery.showListView()

Shows list view and hides thumbnail view

Kind: instance method of Gallery
Access: public

gallery.toggleListView()

Toggles list and thumbnail views

Kind: instance method of Gallery
Access: public

"imagefocus"

Gallery image has gained focus

Kind: event emitted by Gallery

"imageblur"

Gallery image has blurred

Kind: event emitted by Gallery

Prerequisites:

  • Node.jsbrew install node
  • Grunt - npm install -g grunt-cli
  • Other prereqs? Python? Virtualenv?

Demo:

Install dependencies:

npm install

Build the things:

npm run sass
npm run js
npm run docs

Hint your JS

npm run jshint

Python the pythons:

npm run demo-install

Start the demo server:

python demo.py