Socket
Socket
Sign inDemoInstall

svelte-algolia

Package Overview
Dependencies
17
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.2 to 0.1.3

16

package.json
{
"name": "svelte-algolia",
"version": "0.1.2",
"version": "0.1.3",
"description": "Algolia plugin for Svelte",

@@ -14,8 +14,10 @@ "main": "src/index.js",

"license": "MIT",
"private": false,
"dependencies": {
"algoliasearch": "^4.5.1",
"esm": "^3.2.25"
},
"devDependencies": {
"algoliasearch": "^4.5.1",
"ava": "^3.13.0",
"dotenv": "^8.2.0",
"eslint": "^7.12.1",
"esm": "^3.2.25",
"prettier": "^2.1.2"

@@ -25,6 +27,6 @@ },

"test": "ava",
"prepublish": "ava"
"prepublishOnly": "ava"
},
"files": [
"src/**/*.js"
"src"
],

@@ -39,2 +41,2 @@ "keywords": [

}
}
}

@@ -7,2 +7,6 @@ <p align="center">

[![Test Status](https://github.com/janosh/svelte-algolia/workflows/ci/badge.svg)](https://github.com/janosh/svelte-algolia/actions)
This package was inspired by the official [`gatsby-plugin-algolia`](https://github.com/algolia/gatsby-plugin-algolia).
## Usage

@@ -26,3 +30,2 @@

apiKey: secrets.algoliaAdminKey,
partialUpdates: true,
indices: [

@@ -43,4 +46,48 @@ { name: `pokedex`, getData: pokemonDataLoader },

## Config Options
```js
const defaultConfig = {
verbosity: 1, // 0, 1 or 2 for no/some/lots of logging
partialUpdates: false, // if true, figures out diffs between existing
// items and new ones and only uploads, otherwise, completely overrides
// each index on every call to indexAlgolia()
matchFields: [], // (only used when partialUpdates is true) keys of fields to
// check for whether an item has changed; could e.g. be a timestamp, hash or
// an ID that's updated every time the item has changed
}
```
## As a `rollup` plugin
To use this package as part of a `rollup` build (e.g. in a Svelte or Sapper app), simply include it in your `plugins` array:
```js
// rollup.config.js
import { indexAlgolia } from 'svelte-algolia'
const algoliaConfig = {
// see config options above
}
// check if running in build or development mode
const dev = process.env.NODE_ENV === `development`
export default {
input: './src/index.js',
output: {
file: './build/bundle.js',
format: 'iife',
name: 'bundle'
plugins: [
// to save Algolia indexing operations, you may want to only
// update your indices when building your app for production
!dev && indexAlgolia(algoliaConfig),
]
}
}
```
## Contribute
PRs are welcome but best open an issue first to discuss any changes.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc