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

etk

v0.1.1

Published

Elastic search tool kit.

Downloads

11

Readme

ElasticSearch Tool Kit

Makes life easy with ElasticSearch.

Linux Build Dependency Status devDependency Status

elastic = require('elasticsearch');
Etk = require('etk');

// Elasticsearch instance is initialized as documented at it's
// project space
var client = elastic.Client({hosts: ['localhost:9200']});

// Etk instance "tk_1" calls against index = my_index and type = my_type
var tk_1 = Etk(client, {index: "my_index", type: "my_type"});

// search Etk API call returns back the search result
tk_1.search("foo", "bar", function (err, resp) {

    // Etk inserts "source()" method to response, so you can easily get 
    // the data array found in search
    console.log(JSON.stringify(resp.source());
    
    // Etk inserts "score()" method to response, so you can easily get 
    // the score array found in search
    console.log(JSON.stringify(resp.score());
            
    // elasticsearch original response can be reached from resp.resp 
    // for further data manipulation for special cases.
    console.log(JSON.stringify(resp.resp);
});

// Etk instance "tk_2" forwards elasticsearch error and response messages
// to application. See class documentation for full list of options
// you can configure
var tk_2 = Etk(client, {index: "another_index",
                        type: "another_type",
                        raw_response: true,
                        raw_error: true});

// search Etk API call returns back the search result
tk_2.search("baz", "bar", function (err, resp) {

        // Application should handle raw error and response messages
        // received from elasticsearch.
        ...
});

Installation

$ npm install etk

Features

  • Provides high level, easy to use interface for Elastic Search in your Node.js project.
  • Etk extents the official elasticsearch project with well documented function calls.
  • Parses elasticsearch error and response messages in useful ways. Yet you have the option to receive them as they are with configuration options.
  • Uses same elasticsearch instance in multiple Etk clients.
  • All API calls are tested against the latest elasticsearch release.
  • Elasticsearch can be used alongside with Etk without any code change.

API Documentation with Examples

Project site documents the latest NPM release.

TODO

  • Currently project covers a very small subset of possible function calls. Please extend the library and open a pull request for merge.
  • Promise support is missing. Only callback mechanism is implemented.
  • Browser support is not available yet.

People

Original author of Etk is R. Saltuk Alakus

Looking for maintainers. Please drop me an email at [email protected]

License

MIT