@ketch-com/resourcename-js
TypeScript icon, indicating that this package has built-in type declarations

0.2.18 • Public • Published

resourcename

Ketch Resource Name library in TypeScript.

Example Resource Names:

srn:$service:$region:$tenant:$account:$organization:$resource/$info1/$info2
srn:$service:$region:$tenant:$account:$organization:$resource/$info
srn:$service:$region:$tenant:$account:$organization:$resource
srn:$service:$region:$tenant::$organization:$resource
srn:$service:*:$tenant::$organization:*

Installation

npm install -D @ketch-com/resourcename-js

Usage

Format

To format a ResourceName, create the ResourceName object and call string():

import {ResourceName} from '@ketch-com/resourcename-js';

console.log(ResourceName({
    service:      'service',
    region:       'region',
    tenant:       'tenant',
    account:      'account',
    organization: 'organization',
    resource:     'resource',
    info:         ['info1', 'info2'],
}).string());

Parse

To parse the ResourceName from a string, use parse:

import {parse} from '@ketch-com/resourcename-js';

const rn = parse('srn:service:region:tenant:account:organization:resource/info1/info2');

Readme

Keywords

none

Package Sidebar

Install

npm i @ketch-com/resourcename-js

Weekly Downloads

1

Version

0.2.18

License

MIT

Unpacked Size

35.8 kB

Total Files

7

Last publish

Collaborators

  • sethswitchbit
  • ketch-ci