# schema-prefix-uri

> returns json-schema with any id's or $ref's prefixed as a uri

Latest version **1.0.0** (published 2014-08-10) · AGPLv3 license · 0 weekly downloads

## Install

```sh
npm install schema-prefix-uri
pnpm add schema-prefix-uri
yarn add schema-prefix-uri
bun add schema-prefix-uri
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-08-10 |
| First published | 2014-08-10 |
| Weekly downloads | 0 |
| License | AGPLv3 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ahdinosaur |
| Maintainers | ahdinosaur |
| Keywords | openappjs, schema, json-schema, $ref, id, uri |

## Links

- npm: https://www.npmjs.com/package/schema-prefix-uri
- Repository: https://github.com/openappjs/schema-prefix-uri
- Issues: https://github.com/openappjs/schema-prefix-uri/issues
- npm.io page: https://npm.io/package/schema-prefix-uri

## Dependencies (3)

- [xtend](https://npm.io/package/xtend.md) ^4.0.0
- [traverse](https://npm.io/package/traverse.md) ^0.6.6
- [valid-url](https://npm.io/package/valid-url.md) ^1.0.9

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2014-08-10

## README

# schema-prefix-uri

returns json-schema with any id's or $ref's prefixed as a uri

## install

with [npm](http://npmjs.org), do:

```
npm i --save schema-prefix-uri
```

## example

```
var schemaPrefixUri = require('schema-prefix-uri');


var agentSchema = {
  id: "Agent",
  oneOf: [{
    $ref: "Person",
  }, {
    $ref: "http://other.org/Group",
  }]
};

var prefix = "http://example.org/";

var prefixedAgentSchema = schemaPrefixUri(prefix, agentSchema);

console.log(JSON.stringify(prefixedAgentSchema, null, 2));
//{
//  "id": "http://example.org/Agent",
//  "oneOf": [
//    {
//      "$ref": "http://example.org/Person"
//    },
//    {
//      "$ref": "http://other.org/Group"
//    }
//  ]
//}
```

## license

AGPLv3

---
_Source: https://npm.io/package/schema-prefix-uri · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
