1.1.5 • Published 3 years ago

host-pattern v1.1.5

Weekly downloads
2
License
BSD-3-Clause
Repository
github
Last release
3 years ago

host-pattern

Install

npm install --save host-pattern

Usage

expand

const hostPattern = require('host-pattern');

// Lists (comma-separated):
hostPattern.expand('example.net,www.host.com');
// [
//   "example.net",
//   "www.host.com"
// ]

// Ranges:
hostPattern.expand('my-host<1,3-5>.example.com');
// [
//   "my-host1.example.com",
//   "my-host3.example.com",
//   "my-host4.example.com",
//   "my-host5.example.com"
// ]

abbreviate

const hostPattern = require('host-pattern');

// Lists (comma-separated):
hostPattern.abbreviate([ 'example.net', 'www.host.com' ]);
// 'example.net,www.host.com'

// Ranges:
hostPattern.abbreviate([
  'my-host1.example.com',
  'my-host3.example.com',
  'my-host4.example.com',
  'my-host5.example.com',
]);
// 'my-host<1,3-5>.example.com'
1.1.5

3 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

5 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago