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

flatman-component

v0.18.1

Published

#### 🚫 18 of 25 tests passed (72%)

Downloads

11

Readme

Flatman Component 0.11.3

License: MIT

🚫 18 of 25 tests passed (72%)

Table of Contents

Overview

Description

Description.md (top)

A Component function to work with flatman-server and flatman. Designed to act as a replacement for the node which flatman-server and flatman generate.

What it does is act as an interface between the component and the this.node.document.

Another thing it does is normalize the Component so that it behaves like a DomNode from flatman-server and flatman. Essentially making sure that if you pass a component around or a DomNode the behavior is consistent.

The Component must be initialized using the facade method.

Example

Example.md (top)

It must be initialized to add a facade to what ever constructor you are using.

You don't need to include the function because the facade it creates will execute the methods on this.

const el = flatman.el;
const proto = el('div').constructor.prototype;
const methods = Object.keys(proto);
Component.facade(methods);

What happens here is let's create a compoment.

Component.create('A', {
  render() {
    // will be set to the `node` property as 'this.node.document'
    return el('div');
  }
});

The Component will expose every method that this.node.document has. So that, additionally to the render method, you inherit anything else that this.node.document prototype exposes.

eg: .remove(), .append(), addClass() etc. Unless these methods are prototypes of the component they will be applied to this.node.document.

Installation

Installation.md (top)

npm i -S flatman-component

Notes

Notes.md (top)

This is a supporting library and is not intended to be used stand alone.

Component.create

Component.create.md (top)

Component.create('name', {
  constructor(props) {
    // optional
  }
  render() {
    return el('div');
  }
});

Tests

   1. Add class.......................................................... βœ…
   2. Add class on 'className' array..................................... βœ…
   4. .appendTo()........................................................ βœ…
   8. Create component................................................... βœ…
   9. Create component (check constructor props)......................... βœ…
  10. Create component (has return value)................................ βœ…
  11. Create component thunk............................................. βœ…
  13. Component.find..................................................... βœ…
  14. getNode().......................................................... βœ…
  15. .is().............................................................. βœ…
  16. Component.onCreate................................................. βœ…
  17. Parent Component................................................... βœ…
  18. Parent Node........................................................ βœ…
  20. .removeChild()..................................................... βœ…
  21. Remove class....................................................... βœ…
  22. trigger().......................................................... βœ…
  23. trigger() undefined 'on'........................................... βœ…
  24. trigger() object................................................... βœ…

   3. .append() ......................................................... 🚫

   5. .before() ......................................................... 🚫

   6. .closest() ........................................................ 🚫

   7. .closest() (string selector) ...................................... 🚫

  12. Disable ........................................................... 🚫

  19. .remove() ......................................................... 🚫

  25. trigger() no node ................................................. 🚫