open-index/open-npm huggingface dataset:
npm package: @hydre/lru_set
Description: A basic lru set implementation
Author: Hydre
Latest version: 0.1.2

# Lru_set

> Basic no-deps Lru Set implementation with timeout support

Add elements in the set and the last used will drop out of it when full.
Elements will also expire and be removed if `max_age` is specified

## 📦 Install

```
npm i @hydre/lru_set
```

## Usage

```js
import Lru from 'lru_set'

const cache = Lru({
  capacity: 5,
  max_age: 100, // if specified, ms before removing an element
  on_eviction: element => { }
})

cache.add(1)
cache.access(5) // returns weither or not an element is still present and also reset his age
```
npm package: @hydre/make_schema
Description: An utility function to build a graphql schema
Author: Hydre
Latest version: 1.3.0

<h1 align=center>@hydre/make_schema</h1>
<p align=center>
  <img src="https://img.shields.io/github/license/hydreio/make_schema.svg?style=for-the-badge" />
  <a href="https://www.npmjs.com/package/@hydre/make_schema">
    <img src="https://img.shields.io/npm/v/@hydre/make_schema.svg?logo=npm&style=for-the-badge" />
  </a>
  <img src="https://img.shields.io/npm/dw/@hydre/make_schema?logo=npm&style=for-the-badge" />
  <img src="https://img.shields.io/github/workflow/status/hydreio/make_schema/CI?logo=Github&style=for-the-badge" />
</p>

<h3 align=center>An utility function to build a graphql schema</h3>

```js
const schema = make_schema({
  document: 'type Query { ping: String! }',
  resolvers: {
    Query: {
      ping: () => 'pong',
    },
    Subscription: {
      ping: {
        resolve: () => 'pong',
        async *subscribe() {
          yield 0
        },
      },
    },
  },
  directives: {
    foo: ({
      resolve, // original resolver
      root, // resolver params in the same order
      parameters, // .
      context, // .
      info, // .
      directive_arguments, // parameters for the directive
    }) => {},
  },
})
```