# webfind

> Web file finder

Latest version **2.0.2** (published 2020-04-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install webfind
pnpm add webfind
yarn add webfind
bun add webfind
```

Provides the command `webfind`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2020-04-16 |
| First published | 2014-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 6 |
| Unpacked size | 133.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | coderaiser |
| Maintainers | coderaiser |
| Keywords | web, find, middleware, express |

## Links

- npm: https://www.npmjs.com/package/webfind
- Repository: https://github.com/cloudcmd/webfind
- Homepage: https://github.com/cloudcmd/webfind.git
- Issues: https://github.com/cloudcmd/webfind/issues
- npm.io page: https://npm.io/package/webfind

## Dependencies (6)

- [debug](https://npm.io/package/debug.md) ^4.0.1
- [rendy](https://npm.io/package/rendy.md) ^3.0.1
- [findit](https://npm.io/package/findit.md) ~2.0.0
- [express](https://npm.io/package/express.md) ^4.14.0
- [join-io](https://npm.io/package/join-io.md) ^2.0.0
- [socket.io](https://npm.io/package/socket.io.md) ^2.0.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2020-04-16
- 2.0.1 — 2020-04-16
- 2.0.0 — 2018-10-02
- 1.0.1 — 2018-04-26
- 1.0.0 — 2017-07-13
- 0.5.8 — 2017-05-10
- 0.5.7 — 2016-10-08
- 0.5.6 — 2016-06-21
- 0.5.5 — 2016-01-10
- 0.5.4 — 2015-10-09
- 0.5.3 — 2015-09-30
- 0.5.2 — 2015-05-21
- 0.5.1 — 2015-02-16
- 0.5.0 — 2015-02-11
- 0.4.5 — 2015-02-11
- … 8 more at https://npm.io/package/webfind/versions

## README

WebFind
=======

Find files in browser with help of serverside.

## Install

`npm i webfind -g`

## Use as standalone

Start `webfind`, go to url `http://localhost:1337`

## API

### Client API

**webfind(element [, prefix], callback)**

- element   - html element, or selector
- prefix    - (optional) prefix to url (same as in server)
- callback  - function to call after init

When prefix set in server and client, you should use same prefix in html.
For example, if you use prefix `/webfind` you should connect
webfind script in this way:

`<script src="/webfind/webfind.js"></script>`


### Server API

**webfind(options);**

Could be used as middleware, or for init `WebFind`.

```js
webfind({
    server: server,/* only one should be passed: */
    socket: socket,/* server or socket  */
    online: true, /* default */
    minify: true, /* default */
    prefix:'/webfind' /* default */
})
```

**webfind.middle(options);**

Middleware function if there is a need of init `socket` in another place.

```js
webfind.middle({
    prefix: '/webfind', /* default */
    online: true, /* default */
    minify: true, /* default */
})
```

## Use as middleware

To use `WebFind` in your programs you should make local install:

`npm i webfind express --save`

And use it in your program

```js
/* server.js */

var webfind     = require('webfind'),
    http        = require('http'),
    express     = require('express'),
    
    app         = express(),
    server      = http.createServer(app),
    
    port        = 1337,
    ip          = '0.0.0.0';
    
app .use(webfind({
        server: server,
        online: true /* load jquery and socket.io from cdn */
    }))
    .use(express.static(__dirname));

server.listen(port, ip);
```

```html
<!-- index.html -->

<div class="webfind"></div>
<script src="/webfind/webfind.js"></script>
<script>
    (function() {
        'use strict';
        
        window.addEventListener('load', load);
        
        function load() {
            window.removeEventListener('load', load);
            
            webfind('.webfind', function() {
                console.log('webfind ready')
            });
        }
    })()
</script>
```

## License

MIT

---
_Source: https://npm.io/package/webfind · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
