# @thxmike/mongoose-url-type

> A url field-type for Mongoose schemas. This is a fork of https://github.com/konsumer/mongoose-type-url

Latest version **1.0.14** (published 2021-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @thxmike/mongoose-url-type
pnpm add @thxmike/mongoose-url-type
yarn add @thxmike/mongoose-url-type
bun add @thxmike/mongoose-url-type
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.14 |
| Published | 2021-07-17 |
| First published | 2021-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10.0.0 |
| Dependencies | 4 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael Rivera |
| Maintainers | thxmike |
| Keywords | mongoose, uuid, schema, type, binary |

## Links

- npm: https://www.npmjs.com/package/@thxmike/mongoose-url-type
- Repository: https://github.com/thxmike/libraries
- Homepage: https://github.com/thxmike/mongoose-type-url
- Issues: https://github.com/thxmike/libraries/issues
- npm.io page: https://npm.io/package/@thxmike/mongoose-url-type

## Dependencies (4)

- [mongoose](https://npm.io/package/mongoose.md) ^5.13.0
- [cryptiles](https://npm.io/package/cryptiles.md) ^4.1.2
- [@types/node](https://npm.io/package/@types/node.md) ^15.12.5
- [normalize-url](https://npm.io/package/normalize-url.md) ^6.1.0

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 1.0.14 (latest) — 2021-07-17
- 1.0.13 — 2021-06-29
- 1.0.9 — 2021-05-06
- 1.0.8 — 2021-05-06
- 1.0.7 — 2021-05-06
- 1.0.6 — 2021-05-06
- 1.0.5 — 2021-05-06
- 1.0.3 — 2021-05-06
- 1.0.2 — 2021-05-06

## README

# mongoose-type-url

A url field-type for Mongoose schemas

[![npm](https://nodei.co/npm/mongoose-type-url.png)](https://www.npmjs.com/package/mongoose-type-url)

[![Greenkeeper badge](https://badges.greenkeeper.io/konsumer/mongoose-type-url.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/konsumer/mongoose-type-url.svg?branch=master)](https://travis-ci.org/konsumer/mongoose-type-url)
[![Code Climate](https://codeclimate.com/github/konsumer/mongoose-type-url/badges/gpa.svg)](https://codeclimate.com/github/konsumer/mongoose-type-url)

## usage

This will validate a url, correctly:

```js
var mongoose = require('mongoose');
require('mongoose-type-url');

var UserSchema = new mongoose.Schema({
    url: {
        work: mongoose.SchemaTypes.Url,
        profile: mongoose.SchemaTypes.Url
    }
});
```

You can also use the stuff in `String` type:

```js
var UserSchema = new mongoose.Schema({
    url: {
        work: {type: mongoose.SchemaTypes.Url, required: true},
        profile: {type: mongoose.SchemaTypes.Url, required: true},
    }
});
```

You can also use it as an array:


```js
var UserSchema = new mongoose.Schema({
    urls: [{type: mongoose.SchemaTypes.Url}]
});
```

---
_Source: https://npm.io/package/@thxmike/mongoose-url-type · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
