# github-url-converter

> A relative paths such as src of script tag or href of link tag in HTML documents convert to URL.

Latest version **1.0.0** (published 2016-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install github-url-converter
pnpm add github-url-converter
yarn add github-url-converter
bun add github-url-converter
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-03-01 |
| First published | 2016-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+16 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Seokjun Hong |
| Maintainers | se0kjun |
| Keywords | github, relative, path, convert, url |

## Links

- npm: https://www.npmjs.com/package/github-url-converter
- Repository: https://github.com/se0kjun/github-url-converter
- Homepage: https://github.com/se0kjun/github-url-converter#readme
- Issues: https://github.com/se0kjun/github-url-converter/issues
- npm.io page: https://npm.io/package/github-url-converter

## Dependencies (3)

- [xmldom](https://npm.io/package/xmldom.md) ^0.1.22
- [github-relative-url](https://npm.io/package/github-relative-url.md) ^1.0.0
- [rawgit-url-formatter](https://npm.io/package/rawgit-url-formatter.md) ^1.0.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-03-01

## README

#github-url-converter

A relative paths such as src of script tag or href of link tag in HTML documents convert to URL.

##Example

The resource such as javascript, css or images in HTML documents in Github have a relative path on the basis of local file system.

	<link rel="stylesheet" media="screen" type="text/css" href="./style.css">

A href of link tag has a relative path; `./style.css` So github-url-converter convert `./style.css` to `https://cdn.rawgit.com/drzix/Hongseokzip/master/./style.css` you can access.

##Install

	npm install github-url-converter --save

##Usage

	var githubConverter = require('github-url-converter');

	// HTML code
	var htmlCode = '<link rel="stylesheet" media="screen" type="text/css" href="./style.css">';

	// HTML URL
	var htmlUrl = 'https://github.com/drzix/Hongseokzip/blob/master/index.html';
	var doc = githubConverter(htmlCode, htmlUrl);

##Reference

You can use [github-relative-url](https://github.com/se0kjun/github-relative-url) when you want to convert `./style.css` to `https://github.com/drzix/Hongseokzip/blob/master/./style.css` not cdn. And you can use [rawgit-url-formatter](https://github.com/se0kjun/rawgit-url-formatter) when you want to convert `https://github.com/drzix/Hongseokzip/blob/master/./style.css` to raw content URL.

##LICENSE

MIT © [Seokjun Hong](https://github.com/se0kjun)

---
_Source: https://npm.io/package/github-url-converter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
