create-instantsearch-app
⚡️ Build InstantSearch apps at the speed of thought
Last updated 9 months ago by francoischalifour .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install create-instantsearch-app 
SYNC missed versions from official npm registry.

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).

Preview

<summary> Contents</summary>

Get started

The tool requires Node ≥ 8.

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

npx is a tool introduced in npm@5.2.0 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

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
    --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
    -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.

config.json
{
  "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"],
  "attributesForFaceting": ["brand", "location"]
}

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'],
  attributesForFaceting: ['keywords'],
});

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

Tutorials

Previews

You can use the web templates on CodeSandbox:

License

Create InstantSearch App is MIT licensed.

Current Tags

  • 3.0.0-beta.5                                ...           beta (2 years ago)
  • 4.6.0                                ...           latest (9 months ago)

26 Versions

  • 4.6.0                                ...           9 months ago
  • 4.5.0                                ...           a year ago
  • 4.4.2                                ...           a year ago
  • 4.4.1                                ...           2 years ago
  • 4.4.0                                ...           2 years ago
  • 4.3.2                                ...           2 years ago
  • 4.3.1                                ...           2 years ago
  • 4.3.0                                ...           2 years ago
  • 4.2.0                                ...           2 years ago
  • 4.1.0                                ...           2 years ago
  • 4.0.0                                ...           2 years ago
  • 3.3.0                                ...           2 years ago
  • 3.2.0                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 3.0.0-beta.5                                ...           2 years ago
  • 3.0.0-beta.4                                ...           2 years ago
  • 3.0.0-beta.3                                ...           2 years ago
  • 3.0.0-beta.2                                ...           2 years ago
  • 3.0.0-beta.1                                ...           2 years ago
  • 3.0.0-beta.0                                ...           2 years ago
  • 2.3.0                                ...           3 years ago
  • 2.2.0                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |