Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docsearch.js

Package Overview
Dependencies
Maintainers
59
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docsearch.js - npm Package Compare versions

Comparing version 2.6.3 to 3.0.0-beta.0

dist/es/docsearch.js

101

package.json
{
"name": "docsearch.js",
"version": "2.6.3",
"description": "Add an autocomplete dropdown to your documentation",
"main": "dist/npm/index.js",
"scripts": {
"build": "./scripts/build",
"build:css": "./scripts/build-css",
"build:js": "./scripts/build-js",
"docs:build": "cd ./docs && yarn build",
"docs:serve": "cd ./docs && yarn serve",
"docs:deploy": "cd ./docs && yarn deploy",
"doctoc": "doctoc --maxlevel 3 README.md CONTRIBUTING.md",
"lint": "./scripts/lint",
"format:scss": "prettier --write ./src/**/*.scss",
"format:md": "prettier --write '**/*.md'",
"release": "./scripts/release",
"serve": "./scripts/serve",
"test": "./scripts/test",
"test:watch": "./scripts/test-watch"
"version": "3.0.0-beta.0",
"license": "MIT",
"homepage": "https://community.algolia.com/docsearch/",
"repository": "algolia/docsearch",
"author": {
"name": "Algolia, Inc.",
"url": "https://www.algolia.com"
},

@@ -25,62 +14,24 @@ "files": [

],
"author": "Algolia <support@algolia.com> (https://github.com/algolia/)",
"license": "MIT",
"repository": "algolia/docsearch",
"renovate": {
"extends": [
"config:library",
"schedule:weekends",
":automergeMinor",
":automergeBranchPush",
":semanticCommits",
":rebaseStalePrs",
":timezone(Europe/Paris)"
]
"source": "src/index.ts",
"module": "dist/es/index.js",
"main": "dist/umd/index.js",
"umd:main": "dist/umd/index.js",
"unpkg": "dist/umd/index.js",
"jsdelivr": "dist/umd/index.js",
"sideEffects": false,
"scripts": {
"build:umd": "rollup --config",
"build:es": "babel src --root-mode upward --extensions '.js,.ts,.tsx' --ignore '**/__tests__/**/*','**/__mocks__/**/*','**/__fixtures__/**/*' --out-dir dist/es --quiet",
"build:prepare": "yarn run build:es",
"build:types": "tsc --emitDeclarationOnly",
"build": "yarn run build:umd && yarn run build:es && yarn run build:types",
"watch": "babel src --root-mode upward --extensions '.js,.ts,.tsx' --ignore '**/__tests__/**/*','**/__mocks__/**/*','**/__fixtures__/**/*' --out-dir dist/es --quiet --watch",
"type-check": "tsc --noEmit"
},
"devDependencies": {
"autoprefixer": "9.1.1",
"babel-cli": "6.26.0",
"babel-core": "6.26.3",
"babel-eslint": "8.2.6",
"babel-istanbul": "0.12.2",
"babel-jest": "23.6.0",
"babel-loader": "7.1.5",
"babel-plugin-rewire": "1.2.0",
"babel-preset-env": "1.7.0",
"babel-preset-stage-3": "6.24.1",
"conventional-changelog-cli": "2.0.21",
"cssnano": "4.1.10",
"eslint": "5.4.0",
"eslint-config-algolia": "13.3.0",
"eslint-config-prettier": "4.2.0",
"eslint-plugin-import": "2.17.2",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-prettier": "2.7.0",
"jest": "23.6.0",
"jsdom": "11.12.0",
"json": "9.0.6",
"live-server": "1.2.1",
"mversion": "1.13.0",
"node-sass": "4.12.0",
"onchange": "4.1.0",
"parallelshell": "3.0.2",
"postcss-cli": "6.1.2",
"prettier": "1.17.0",
"pretty-bytes-cli": "2.0.0",
"semver": "6.0.0",
"sinon": "7.3.2",
"uglify-js": "3.5.11",
"webpack": "3.12.0",
"webpack-cli": "3.3.2"
},
"peerDependencies": {},
"dependencies": {
"algoliasearch": "^3.24.5",
"autocomplete.js": "0.36.0",
"hogan.js": "^3.0.2",
"request": "^2.87.0",
"stack-utils": "^1.0.1",
"to-factory": "^1.0.0",
"zepto": "^1.2.0"
"docsearch-core": "3.0.0-beta.0",
"docsearch-renderer-downshift": "3.0.0-beta.0",
"docsearch-types": "3.0.0-beta.0",
"preact": "^8.4.2"
}
}

@@ -1,51 +0,65 @@

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
# DocSearch.js
- [Related projects](#related-projects)
Library that packages DocSearch in a single function.
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Installation
[![DocSearch][1]][8]
```sh
npm install docsearch.js
# or
yarn add docsearch.js
```
The easiest way to add search to your documentation. For free.
## Usage
[![npm version][2]](https://npmjs.org/package/docsearch.js)
[![build][3]](https://travis-ci.org/algolia/docsearch)
[![coverage][4]](https://coveralls.io/github/algolia/docsearch)
[![License][5]](./LICENSE)
[![Downloads][6]](https://npm-stat.com/charts.html?package=docsearch.js)
[![jsDelivr Hits][7]](https://www.jsdelivr.com/package/npm/docsearch.js)
```ts
docsearch({
indexName: 'YOUR_INDEX_NAME',
apiKey: 'YOUR_API_KEY',
container: 'input[type="search"]',
});
```
DocSearch will crawl your documentation website, push its content to an Algolia
index, and allow you to add a dropdown search menu for your users to find
relevant content in no time.
## API
Check out our [website][8] for a complete explanation and documentation.
### `docsearch(options)`
[![Bootstrap demo][9]][8]
```ts
docsearch({
container,
placeholder,
stalledSearchDelay,
onItemSelect,
onItemHighlight,
}: DocSearchOptions);
## Related projects
DocSearch is made of 3 repositories:
- [algolia/docsearch][10] contains the `docsearch.js` code source and the
documentation website.
- [algolia/docsearch-configs][11] contains the JSON files representing all the
configs for all the documentations DocSearch is powering
- [algolia/docsearch-scraper][12] contains the crawler we use to extract data
from your documentation. The code is open-source and you can run it from
a Docker image
[1]: ./.github/docsearch-logo.svg
[2]: https://img.shields.io/npm/v/docsearch.js.svg?style=flat-square
[3]: https://img.shields.io/travis/algolia/docsearch/master.svg?style=flat-square
[4]: https://img.shields.io/coveralls/algolia/docsearch/master.svg?style=flat-square
[5]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square
[6]: https://img.shields.io/npm/dm/docsearch.js.svg?style=flat-square
[7]: https://data.jsdelivr.com/v1/package/npm/docsearch.js/badge
[8]: https://community.algolia.com/docsearch/
[9]: ./.github/demo.gif
[10]: https://github.com/algolia/docsearch
[11]: https://github.com/algolia/docsearch-configs
[12]: https://github.com/algolia/docsearch-scraper
interface DocSearchOptions extends DocSearchCoreOptions {
/**
* The container of the search box.
*/
container: HTMLElement | string;
/**
* The text that appears in the search box input when there is
* no query.
*
* @default `"Search"`
*/
placeholder?: string;
/**
* The number of milliseconds before the search is considered
* as stalled
*
* @default `300`
*/
stalledSearchDelay?: number;
/**
* Function called when the user highlights an item.
* Highlighting happens on hover and on keyboard navigation.
*/
onItemHighlight?({ hit }: { hit: DocSearchHit }): void;
/**
* Function called when the user selects an item.
*/
onItemSelect?({ hit }: { hit: DocSearchHit }): void;
}
```
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc