open-index/open-npm huggingface dataset:
npm package: @minni-im/minni-embed
Description: Minni.im embed foundation. Used to create your owm embed plugins
Author: Benoit Charbonnier
Latest version: 1.1.2

# minni-embed

Foundation layer to provide embed (mostly via [OEmbed](https://oembed.com/)) to [minni-app](https://github.com/minni-im/minni-app) chat application


## Create your on own plugin

To create your own embed plugin, you can have a look at [Youtube Embed](https://github.com/minni-im/minni-embed-youtube)
npm package: @minni-im/tape-recorder
Description: CouchDB nodejs lightweight ORM on top of nano
Author: Benoit Charbonnier
Latest version: 5.0.0-beta.4

# @minni-im/tape-recorder

> a tiny couchdb orm on top of [nano](https://github.com/apache/couchdb-nano)

**_why?_**

`nano` is already great. But manipulating Documents and Models classes is better sometimes.

## Install

```
$ npm install --save @minni-im/tape-recorder
```

## Usage

**_Basic usage_**

```js
import recorder from "@minni-im/tape-recorder";

const { registerModel } = recorder("http://localhost:5984/<dbname>");

const User = registerModel("User", {
	firstName: String,
	lastName: String,
});

const john = new User({
	firtName: "John",
	lastName: "Doe",
});
await john.save();
```

**_Schema definitions_**

```javascript
import recorder, { Schema } from "@minni-im/tape-recorder";

const { registerModel } = recorder("http://localhost:5984/<dbname>");

const UserSchema = new Schema({
	firstName: String,
	lastName: String,
	email: {
		type: String,
		view: true, // will create a couchdb view named "by_email"
	},
});

UserSchema.virtual("fullName", {
	get() {
		return this.firstName + " " + this.lastName;
	},
});

const User = registerModel("User", UserSchema);
```

**_CRUD usage_**

```js
import recorder, { Schema } from "@minni-im/tape-recorder";

const { registerModel } = recorder("http://localhost:5984/<dbname>");

// Schema
const UserSchema = new Schema({
	firstName: String,
	lastName: String,
});
const User = registerModel("User", UserSchema);

// Create
const user = new User({
	firstName: "John",
	lastName: "Doe",
});
await user.save();

// or
const user = await User.create({
	firstName: "John",
	lastName: "Doe",
});

// Update
user.firstName = "Jane";
await user.save();

// Delete
await user.delete();

// Read
const users = await User.findAll();
const user = await User.findById(userId);
```

**_Retrieving models by name_**

```js
import recorder, { Schema } from "@minni-im/tape-recorder";

const { registerModel, model } = recorder("http://localhost:5984/<dbname>");

const User = registerModel("User", {
	firstName: String,
	lastName: String,
});

User === model("User");
```

## Authentication

To connect using authentication, you can provide any [nano](https://github.com/apache/couchdb-nano) supported options to the `recorder()` method.

```js
import recorder from "@minni-im/tape-recorder";

const { registerModel, model } = recorder({
	url: "http:.//localhost:5984/<dbName>",
	requestDefaults: {
		auth: {
			username: process.env.COUCH_USER,
			password: process.env.COUCH_PASSWORD,
		},
	},
});
```

## license

copyright 2022 Benoit Charbonnier

licensed under the apache license, version 2.0 (the "license"); you may not use this file except in compliance with the license. you may obtain a copy of the license at

http://www.apache.org/licenses/LICENSE-2.0.html
unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "as is" basis, without warranties or conditions of any kind, either express or implied. see the license for the specific language governing permissions and limitations under the license.