vamtiger-get-local-stylesheet-paths
v0.0.3
Published
Get an array of local stylesheet links for defined HTML document text.
Downloads
3
Maintainers
Readme
VAMTIGER Get Local Stylesheet Paths
VAMTIGER VAMTIGER Get Local Stylesheet Paths will return a list of local stylesheet paths for defined HTML document text.
Installation
VAMTIGER VAMTIGER Get Local Stylesheet Paths can be installed using npm or yarn:
npm i --save vamtiger-get-local-stylesheet-paths
or
yarn add vamtiger-get-local-stylesheet-paths
Usage
Import or require a referece to VAMTIGER VAMTIGER Get Local Stylesheet Paths:
import getLocalStylesheetPaths from 'vamtiger-get-local-stylesheet-paths';
or
const getLocalStylesheetPaths = require('vamtiger-get-local-stylesheet-paths').default;
VAMTIGER VAMTIGER Get Local Stylesheet Paths will return a list of local stylesheet paths for defined HTML document text.
const getLocalStylesheetPaths = require('vamtiger-get-local-stylesheet-paths').default
const html = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>
Some HTML Title
</title>
<link href="https://remote/stylesheet/link/index.css" rel="stylesheet">
<link href="local/stylesheet/link/index.css" rel="stylesheet">
</head>
<body>
<div>
Some HTML body inner HTML
</div>
</body>
</html>
`;
const localStylesheetLinks = getLocalStylesheetPaths({ html })
// .then(handleResult)
// .catch(handleError);
/* [
'local/stylesheet/link/index.css'
] */
VAMTIGER VAMTIGER Get Local Stylesheet Paths can also be more conveniently referenced inside an async function.
const getLocalStylesheetPaths = require('vamtiger-get-local-stylesheet-paths').default
const html = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>
Some HTML Title
</title>
<link href="https://remote/stylesheet/link/index.css" rel="stylesheet">
<link href="local/stylesheet/link/index.css" rel="stylesheet">
</head>
<body>
<div>
Some HTML body inner HTML
</div>
</body>
</html>
`;
async function someAsyncFunction() {
const localStylesheetLinks = await getLocalStylesheetPaths({ html });
/* [
'local/stylesheet/link/index.css'
] */
}