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

@ndlib/aws-opensearch

v1.0.8

Published

Library for interacting with AWS OpenSearch

Downloads

21

Readme

AWS OpenSearch

This is a plugin designed to facilitate any interaction with AWS OpenSearch. In order to use this plugin, several assumptions are made. Those are listed below.

  • First, OpenSearch requires either IAM signed operations, which requires a lot of setup and the use of authentication keys, or it requires the use of Basic HTTP Authentication. We use the latter.
  • Given the previous assumption, you will need to provide in the context for your consuming application the username and password required to interact with OpenSearch
  • We also assume that all request and response bodies transferred using REST interactions are serialized using JSON - if you attempt interaction with OpenSearch using another data format it will not work
  • The JSON body passed to OpenSearch should be just that - JSON, not a string. The response body will be JSON. JSON in, and JSON out.
  • The plugin provides basic error checking - whether the connection was successful, whether a response was received from the OpenSearch API and what that response was. However, it makes no assumptions about what "success" looks like when indexing a document. The consuming application is responsible for determining whether the operation was truly a success.
  • All interactions with OpenSearch happen over HTTPS

Configuration Parameters Needed

  • You will need the host name of your OpenSearch domain
  • You will need the Basic Auth credentials
  • You will need the name of the index you will use within your search domain

Example of use

How to use (in gatsby-config.js):

import { opensearch_mappings } from './content/opensearch/mappings'
import { opensearch_query } from './content/opensearch/query'
import { opensearch_selector } from './content/opensearch/selector'

...

module.exports = {
  plugins: [
    ...
    {
      resolve: '@ndlib/aws-opensearch',
      options: {
        opensearch_hostname: <hostname>,
        opensearch_password: <password>,
        opensearch_port: <port-number>,
        opensearch_protocol: <http | https>
        index_name: <index_name>,
        content_grouping: 'bulk' | 'individual',
        query: opensearch_query,
        unique_id: <unique_id_field>,
        selector: opensearch_selector,
        mappings: opensearch_mappings
      }
    },
    ...
  ]
}

| Parameter | Description | Required | | ------------- |:-------------| ----- | | opensearch_hostname | The OpenSearch host name associated with the endpoint for the search domain being used. | yes | | opensearch_password | The password required that allows write operations against the domain | yes | | opensearch_port | The port number used by the OpenSearch api | yes | | opensearch_protocol | There are only two options: http or https | yes | | index_name | The name of the OpenSearch index. | yes | | content_grouping | Two options: either 'bulk' or 'individual' referring to the number of documents being indexed. | yes | | query | The GraphQL query used to build the data set to be indexed | yes | | unique_id | The GraphQL query used to build the data set to be indexed | yes | | selector | A function to remap the query data to the top level. | yes | | mappings | A function to create custom mappings for OpenSearch. | yes |