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

algoliasearch-helper-mc

v2.1.1

Published

Helper for implementing advanced search features with algolia

Downloads

3

Readme

Coming from V1 (or js client v2)? Read the migration guide to the new version of the Helper.

algoliasearch-helper-js

This module is the companion of the algoliasearch-client-js. It helps you keep track of the search parameters and provides a higher level API.

The helper is built on top of algoliasearch-client-js and this version is specifically made to work with the newest V3 versions of it.

Features

  • Search parameters tracking
  • Facets exclusions
  • Pagination
  • Disjunctive facetting (search on two or more values for a single facet)

What does it look like?

A small example that uses Browserify to manage modules.

var algoliasearch = require( "algoliasearch" );
var algoliasearchHelper = require( "algoliasearch-helper" );

var client = algoliasearch( "app_id", "secret" );

var helper = algoliasearchHelper( client, "myMainIndex", { 
  facets : [ "mainCharacterFirstName", "year" ],
  disjunctiveFacets : [ "director" ]
});

helper.on( "result", function( data ){
  console.log( data.hits );
} );

helper.addDisjunctiveRefine( "director", "Clint Eastword" );
helper.addDisjunctiveRefine( "director", "Sofia Coppola" );

helper.addNumericRefinement( "year", "=", 2003 );

// Search for any movie filmed in 2003 and directed by either C. Eastwood or S. Coppola
helper.search();

How to use this module

Have a look at the JSDoc

See the examples in action

Use with NPM

npm install algoliasearch-helper

Use with bower

bower install algoliasearch-helper

Use the CDN

Include this in your page :

<script src="//cdn.jsdelivr.net/algoliasearch.helper/2.0.0/algoliasearch.helper.min.js"></script>

How to contribute

  • fork this repo
  • clone the repository git clone https://github.com/[your-handle-here]/algoliasearch-helper-js.git
  • make your fix or feature
  • launch the dev mode npm run dev
  • add a test for your feature (see /test folder)
  • make sure, it goes through the linter without an error npm run lint
  • propose your pull request
  • profit :)

A quick note though, even though we'll make our best to read and integrate your PR, we may be a bit slow. Sorry :). We might also make some comments and discussions too, for the best interest of this library. Thanks in advance for your contribution!