# ubborg-bundleurl-util-pmb

> Convert and resolve ubborg bundle URLs.

Latest version **0.1.2** (published 2023-11-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install ubborg-bundleurl-util-pmb
pnpm add ubborg-bundleurl-util-pmb
yarn add ubborg-bundleurl-util-pmb
bun add ubborg-bundleurl-util-pmb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2023-11-21 |
| First published | 2020-06-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | M.K. |
| Maintainers | mk-pmb |

## Links

- npm: https://www.npmjs.com/package/ubborg-bundleurl-util-pmb
- Repository: https://github.com/mk-pmb/ubborg-bundleurl-util-pmb-js
- Homepage: https://github.com/mk-pmb/ubborg-bundleurl-util-pmb-js/#readme
- Issues: https://github.com/mk-pmb/ubborg-bundleurl-util-pmb-js/issues
- npm.io page: https://npm.io/package/ubborg-bundleurl-util-pmb

## Recent versions

- 0.1.2 (latest) — 2023-11-21
- 0.1.1 — 2020-07-05
- 0.1.0 — 2020-06-23

## README

<!--#echo json="package.json" key="name" underline="=" -->
ubborg-bundleurl-util-pmb
=========================
<!--/#echo -->

<!--#echo json="package.json" key="description" -->
Convert and resolve ubborg bundle URLs.
<!--/#echo -->



API
---

This module exports an object that holds these functions and properties:


### .shorten(url)

Return a less cluttered, more human-readable representation.
This works on a purely theoretical basis, with no actual system state lookups.
Thus, it will not try to read meaning into URLs, e.g. will not try to guess
a "simpler" more symbolic URL just because it would happen to point to the
same target given current system state.


### .href(baseUrl[, dest])

Returns the full target URL, deciphering the meaning of
potentially-relative `dest` URLs and potentially `.shorten()`ed `baseUrl`s.
If `dest` is omitted or false-y, returns the full ("un-`shorten()`-ed")
representation of `baseUrl`.


### .toModuleId(url[, opt])

Return a CommonJS-style module identifiers suitable for dynamic import.
This works on a purely theoretical basis, with no actual file system lookups.
Thus, if the `url` assumes ubborg-specific features like slashable import,
the resulting module identifiers may require a suitably extended dynamic
import facility.

`opt` is an optional options object that supports these optional keys:

* `ifUnsupported`: If `url` cannot be understood as anything that could be
  resolved to a CJS module ID, and this option is set to anything other than
  `undefined`, the option value is returned, rather than an Error thrown.



### .cwdUrl

String with a URL that represents the current working directory.







Usage
-----

see [test/usage.mjs](test/usage.mjs).


<!--#toc stop="scan" -->



Known issues
------------

* Needs more/better tests and docs.




&nbsp;


License
-------
<!--#echo json="package.json" key=".license" -->
ISC
<!--/#echo -->

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