# schema-loader

> A schema loader that takes into account file name and directory structure when registering and getting schemas

Latest version **1.1.1** (published 2016-03-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install schema-loader
pnpm add schema-loader
yarn add schema-loader
bun add schema-loader
```

## 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.1.1 |
| Published | 2016-03-01 |
| First published | 2016-02-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | jordan piepkow |
| Maintainers | jpiepkow |
| Keywords | service, locator |

## Links

- npm: https://www.npmjs.com/package/schema-loader
- npm.io page: https://npm.io/package/schema-loader

## Recent versions

- 1.1.1 (latest) — 2016-03-01
- 1.1.0 — 2016-02-19
- 1.0.2 — 2016-02-19
- 1.0.1 — 2016-02-19
- 1.0.0 — 2016-02-19

## README

schema-loader
===
Description: A schema loader that takes into account file name and directory structure when registering and getting schemas

##Starting out

	npm install schema-loader
	
	var loader = require('schema-loader')();

##Example file structure:

	Schemas(directory)
		schemaOne(file)
		schemaTwo(file)
		schemaThree(file)
		
##Example schema file:
	//email.js
	module.exports: {
		email: SCHEMA,
		secondary_schema: SCHEMA
	};
	
	NOTE DEFAULT SCHEMA SHOULD BE NAMED SAME AS FILE NAME
	
	ex.
	
	if file is email.js your exported object should have a property called email		
	

##Methods

###loader.register(name,schema); // registers a schema object to the loader
###loarder.registerAll(PATH); //registers all schema objects from a directory to a loader
###loader.get(name,overload(optional)); //get schema(default unlee pass in overload string)


##EXAMPLE

Examples of use are in test directory in module

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