Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jedireza/reserved-subdomains
:package: A list of names that should be reserved in multitenant apps.
https://github.com/jedireza/reserved-subdomains
multitenancy reserved saas subdomain
Last synced: about 2 months ago
JSON representation
:package: A list of names that should be reserved in multitenant apps.
- Host: GitHub
- URL: https://github.com/jedireza/reserved-subdomains
- Owner: jedireza
- License: mit
- Created: 2017-12-08T00:45:55.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T18:23:20.000Z (almost 2 years ago)
- Last Synced: 2024-10-22T20:49:57.799Z (2 months ago)
- Topics: multitenancy, reserved, saas, subdomain
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/reserved-subdomains
- Size: 429 KB
- Stars: 46
- Watchers: 4
- Forks: 10
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# reserved-subdomains
A list of names that should be reserved in multitenant apps.
## Install
```bash
$ npm install reserved-subdomains
```## API reference
- [Properties](#properties)
- [`names`](#names)
- [`nameMap`](#namemap)
- [`patterns`](#patterns)
- [`patternsRegex`](#patternsregex)
- [Methods](#methods)
- [`isNotValid(name)`](#isnotvalidname)
- [`isValid(name)`](#isvalidname)### Properties
#### `names`
An array of strings. Ex: `['www', 'ftp', 'mail', ...]`.
#### `nameMap`
An object where keys are names. Ex: `{ www: true, ftp: true, mail: true, ...}`.
#### `patterns`
An array of regular expression strings. Ex: `['ww[a-z0-9-]+', 'ftp[0-9]+', 'mail[0-9]+', ...]`.
#### `patternsRegex`
An array of regular expression objects. Ex: `[/ww[a-z0-9-]+/, /ftp[0-9]+/, /mail[0-9]+/, ...]`.
### Methods
#### `isNotValid(name)`
Returns `true` if the name _is not_ valid where:
- `name` - the name to test.
#### `isValid(name)`
Returns `true` if the name _is_ valid where:
- `name` - the name to test.
## Inspired by
https://github.com/nkkollaw/reserved-subdomains
## License
MIT