Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

mongoose-type-ethereum-address

1.1.5 • Public • Published

CircleCI Coverage

Mongoose Ethereum address type

An Ethereum address field-type for Mongoose schemas.

Installing

yarn add mongoose-type-ethereum-address

Usage

This will correctly validate an Ethereum's address Mongoose model's field:

import mongoose from "mongoose";
import "mongoose-type-ethereum-address";
 
export const schema = new mongoose.Schema({
  address: mongoose.Schema.Types.EthereumAddress
});

You can also use it with arrays:

export const schema = new mongoose.Schema({
  addresses: [{ type: mongoose.Schema.Types.EthereumAddress }]
});

Donations

Please if you like my work consider donating something. Every offer helps me giving out the best software!

  • Bitcoin: 3JFXQE6mQibmrxoq3YHKqRUHAvmXxuY8r9
  • Ethereum: 0x35E2acD3f46B13151BC941daa44785A38F3BD97A

Thank you all <3

Install

npm i mongoose-type-ethereum-address

DownloadsWeekly Downloads

11

Version

1.1.5

License

MIT

Unpacked Size

6.15 kB

Total Files

11

Last publish

Collaborators

  • avatar