link2aws 1.0.1 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +42 -4
  2. package/link2aws +11 -0
  3. package/link2aws.js +969 -943
  4. package/package.json +8 -4
package/README.md CHANGED
@@ -8,14 +8,40 @@ Copy/paste ARN, get direct link to AWS console
8
8
 
9
9
  Copyright (c) 2020, Felix Kaiser. License: [ISC](https://spdx.org/licenses/ISC.html)
10
10
 
11
+ ![Node.js CI](https://github.com/link2aws/link2aws.github.io/workflows/Node.js%20CI/badge.svg)
12
+
11
13
  ## How to...
12
14
 
13
- ### Use interactively
15
+ ### Use as website
16
+
17
+ Go to [link2aws.github.io](https://link2aws.github.io) (privacy notice: it runs in the browser and does *not* send your input anywhere)
18
+
19
+ Or run directly from source:
20
+
21
+ ```sh
22
+ # git clone https://github.com/link2aws/link2aws.github.io
23
+ # firefox link2aws.github.io/index.html
24
+ ```
25
+
26
+ ### Use as command line tool
27
+
28
+ Via NPM:
29
+
30
+ ```sh
31
+ # npm install -g link2aws
32
+ # link2aws arn:aws:s3:::abcdefgh1234
33
+ https://s3.console.aws.amazon.com/s3/buckets/abcdefgh1234
34
+ ```
35
+
36
+ Or clone the repo and run the file (no setup required):
14
37
 
15
- * Online: go to [link2aws.github.io](https://link2aws.github.io) (privacy notice: it runs in the browser and does *not* send your input anywhere)
16
- * Self-hosted: clone the repo, open `index.html` in your browser (there is no build step)
38
+ ```sh
39
+ # git clone https://github.com/link2aws/link2aws.github.io
40
+ # node link2aws.github.io/link2aws.js arn:aws:s3:::abcdefgh1234
41
+ https://s3.console.aws.amazon.com/s3/buckets/abcdefgh1234
42
+ ```
17
43
 
18
- ### Use via JavaScript API
44
+ ### Use as JavaScript library
19
45
 
20
46
  ```js
21
47
  var link2aws = require('link2aws');
@@ -23,10 +49,22 @@ new link2aws.ARN('arn:aws:s3:::abcdefgh1234').consoleLink
23
49
  // https://s3.console.aws.amazon.com/s3/buckets/abcdefgh1234
24
50
  ```
25
51
 
52
+ Or:
53
+
54
+ ```js
55
+ import { ARN } from 'link2aws';
56
+ new ARN('arn:aws:s3:::abcdefgh1234').consoleLink;
57
+ // https://s3.console.aws.amazon.com/s3/buckets/abcdefgh1234
58
+ ```
59
+
26
60
  If the ARN is invalid, or valid but we have no link for it, an exception is thrown.
27
61
 
28
62
  ### Add support for resource types
29
63
 
64
+ It's super easy - see [this example](https://github.com/link2aws/link2aws.github.io/commit/0432ecbbe522dbbd7e746caeeb4a7d1a6be5f057).
65
+
66
+ Pull requests welcome!
67
+
30
68
  #### Add code
31
69
 
32
70
  * Support for new resource types: see large dict at the end of `link2aws.js`
package/link2aws ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+
3
+ let ARN = require("./link2aws.js").ARN;
4
+
5
+ for (let i = 2; i < process.argv.length; i++) {
6
+ try {
7
+ console.log(new ARN(process.argv[i]).consoleLink);
8
+ } catch (e) {
9
+ console.error(e);
10
+ }
11
+ }