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

ember-cli-filter-component

v3.0.1

Published

An Ember.js component used to filter content based on user input.

Downloads

39

Readme

ember-cli-filter-component

Ember Observer Score Shields.io Build Status

Table of Contents

  • About
  • Installation
  • Usage
    • Sample template
    • Block parameters
    • Properties
  • Development
    • Link ember-cli-filter-component to your project
    • Running tests

About

ember-cli-filter-component provides a {{filter-content}} block component for filtering arrays of items.

  • Live example - external link
  • Sample code - available in EXAMPLES.md
  • Changelog - available in CHANGELOG.md

Installation

cd /path/to/projects/cool-project
ember install ember-cli-filter-component

Usage

Sample template

{{#filter-content content=ingredients properties="name" as |filteredIngredients query|}}
  {{input value=query}}
  {{#each filteredIngredients as |ingredient|}}
    {{! ... }}
  {{/each}}
{{/filter-content}}

Block parameters

{{filter-content as |filtered query|}}

filtered {array}

  • DescriptionComputed result of filtering items from content against query
  • NotePassed as the first block param to the component yield

query {string}

  • DescriptionValue matched against items from content
  • NotePassed as the second block param to the component yield

Properties

content (required) {array.<array, object>}

  • DescriptionItems being checked for matches against query

properties (required) {string}

  • DescriptionProperties on each item to filter
    • Space-delimited
    • Enumerables are represented using @each
    • ex: properties="title category.@each"

timeout {number}

  • DescriptionTime in milliseconds to debounce applying the filter when content, properties, or query
  • Default: 420

query {string}

  • DescriptionValue used to match against items from content

Development

To start developing/testing locally, clone the project to your machine.

cd /path/to/projects
git clone [email protected]:zakmac/ember-cli-filter-component.git

Once cloned, you can start editing and testing in the project folder itself, or include the addon in another project via npm link.

Link ember-cli-filter-component to your project

# create an npm link from the project directory
cd /path/to/projects/ember-cli-filter-component
npm link

# include the npm link in your project
cd /path/to/projects/cool-project
npm link ember-cli-filter-component

The last step is to add "ember-cli-filter-component": "" to the devDependencies section of your project's package.json.

Next time your project is run, the filter-content component will be accessible.

Running tests

The command ember test will run the test suite via CLI, outputting results.

You can also run ember test --server to launch a Test'em browser session.

License

This project is licensed under the MIT License.