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

create-instantsearch-app

v7.5.3

Published

⚡️ Build InstantSearch apps at the speed of thought

Downloads

961

Readme

Create InstantSearch App

⚡️ Build InstantSearch apps at the speed of thought.

Version License Build Status

create-instantsearch-app is a command line utility that helps you quick start your InstantSearch app using any Algolia InstantSearch flavor (InstantSearch.js, React InstantSearch, Vue InstantSearch, Angular InstantSearch, InstantSearch iOS and InstantSearch Android).

Get started

The tool requires Node ≥ 8.

npx create-instantsearch-app my-app
cd my-app
npm start

npx is a tool introduced in [email protected] that makes it possible to run CLI tools hosted on the npm registry.


Alternatively, you can use Yarn:

yarn create instantsearch-app my-app
cd my-app
yarn start

Important Selecting 'Y' when being prompted to ‘Enable user events’ activates the insights option for compatible templates, allowing Algolia to process your user Events. Events can unlock powerful features, enhancing your application's effectiveness and we encourage you to consider enabling this valuable functionality. Please review our API reference for more details about Events collection and settings.

Usage

This package comes with the module createInstantSearchApp(path, options?) and the command-line tool create-instantsearch-app.

$ create-instantsearch-app --help

  Usage: create-instantsearch-app <project-directory> [options]

  Options:

    -v, --version                                      output the version number
    --name <name>                                      The name of the application
    --app-id <appId>                                   The application ID
    --api-key <apiKey>                                 The Algolia search API key
    --index-name <indexName>                           The main index of your search
    --attributes-to-display <attributesToDisplay>      The attributes of your index to display
    --image-attribute <imageAttribute>                 The attribute of your index to use for image display
    --attributes-for-faceting <attributesForFaceting>  The attributes for faceting
    --template <template>                              The InstantSearch template to use
    --library-version <libraryVersion>                 The version of the library
    --config <config>                                  The configuration file to get the options from
    --no-installation                                  Ignore dependency installation
    --no-interactive                                   Do not ask any interactive questions
    -h, --help                                         output usage information

--template

Supported templates are:

create-instantsearch-app my-app --template "React InstantSearch"

You can also create your own template and specify its path.

--config

The config flag is handy to automate app generations.

{
  "name": "my-app",
  "template": "InstantSearch.js",
  "libraryVersion": "2.8.0",
  "appId": "MY_APP_ID",
  "apiKey": "MY_API_KEY",
  "indexName": "MY_INDEX_NAME",
  "searchPlaceholder": "Search",
  "attributesToDisplay": ["name", "description"],
  "imageAttribute": "image",
  "attributesForFaceting": ["brand", "location"],
  "enableInsights": true
}

Create the app based on this configuration:

create-instantsearch-app my-app --config config.json

API

create-instantsearch-app is based on the module createInstantSearchApp(path, options?). The same camel cased options as the CLI are available.

const createInstantSearchApp = require('create-instantsearch-app');

const app = createInstantSearchApp('~/lab/my-app', {
  template: 'InstantSearch.js',
  libraryVersion: '2.0.0',
  attributesToDisplay: ['name', 'description'],
  imageAttribute: 'image',
  attributesForFaceting: ['keywords'],
  enableInsights: true,
});

app.create().then(() => console.log('App generated!'));

Tutorials

Previews

You can use the web templates on CodeSandbox:

Contributing

We welcome all contributors, from casual to regular 💙

To start contributing to the code, you need to:

  1. Fork the project
  2. Clone the repository
  3. Install the dependencies: yarn

Please read our contribution process to learn more.

License

Create InstantSearch App is MIT licensed.