Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/h3poteto/node-memcached-client
Memcached client for nodejs using typescript
https://github.com/h3poteto/node-memcached-client
memcached-client promise typescript
Last synced: 3 months ago
JSON representation
Memcached client for nodejs using typescript
- Host: GitHub
- URL: https://github.com/h3poteto/node-memcached-client
- Owner: h3poteto
- License: mit
- Created: 2019-09-20T06:26:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T08:57:35.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T13:11:05.749Z (4 months ago)
- Topics: memcached-client, promise, typescript
- Language: TypeScript
- Size: 502 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# node-memcached-client
[![Test](https://github.com/h3poteto/node-memcached-client/actions/workflows/test.yml/badge.svg)](https://github.com/h3poteto/node-memcached-client/actions/workflows/test.yml)
[![npm](https://img.shields.io/npm/v/memcached-client)](https://www.npmjs.com/package/memcached-client)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/h3poteto/node-memcached-client)](https://github.com/h3poteto/node-memcached-client/releases)
[![npm](https://img.shields.io/npm/dm/memcached-client)](https://www.npmjs.com/package/memcached-client)
[![NPM](https://img.shields.io/npm/l/memcached-client)](/LICENSE.txt)A Memcached client library for node.js. This library written in typescript and define promisified methods.
## Install
```
$ npm install memcached-client
```or
```
$ yarn add memcached-client
```## Usage
```typescript
import Memcached, { Metadata } from 'memcached-client'// Connect to your memcached server.
const client = new Memcached('127.0.0.1', 11211)const example = async (client: Memcached) => {
const connection = await client.connect()
const code = await connection.set('my-key', 'my-value', false, 0)
console.log(code) // => STORED
const data: { [key: string]: Metadata } = await connection.get('my-key')
if (data['my-key']) {
console.log(data['my-key'].value) // => my-value
}
await connection.close()
}```
And I prepared some [examples](example).
## Roadmap
This library does not yet cover all memcached methods. But I will implement all methods.| memcached-client version | v0.1.x |
|--------------------------|---------|
| get | ✔ |
| set | ✔ |
| delete | ✔ |
| gets | not yet |
| cas | not yet |
| replace | not yet |
| append | not yet |
| prepend | not yet |
| incr/decr | not yet |## License
The software is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).