vamtiger-get-remote-stylesheet-paths
Get a list of remote stylesheet paths for defined HTML document text.
Last updated 2 years ago by vamtiger-project .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vamtiger-get-remote-stylesheet-paths 
SYNC missed versions from official npm registry.

VAMTIGER Get Remote Stylesheet Paths

VAMTIGER VAMTIGER Get Remote Stylesheet Paths will return a list of remote stylesheet paths for defined HTML document text.

Installation

VAMTIGER VAMTIGER Get Remote Stylesheet Paths can be installed using npm or yarn:

npm i --save vamtiger-get-remote-stylesheet-paths

or

yarn add vamtiger-get-remote-stylesheet-paths

Usage

Import or require a referece to VAMTIGER VAMTIGER Get Remote Stylesheet Paths:

import getRemoteStylesheetPaths from 'vamtiger-get-remote-stylesheet-paths';

or

const getRemoteStylesheetPaths = require('vamtiger-get-remote-stylesheet-paths').default;

VAMTIGER VAMTIGER Get Remote Stylesheet Paths will return a list of remote stylesheet paths for defined HTML document text.

const getRemoteStylesheetPaths = require('vamtiger-get-remote-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 remoteStylesheetLinks = getRemoteStylesheetPaths({ html })
    // .then(handleResult)
    // .catch(handleError); 
/* [
'https://remote/stylesheet/link/index.css'
] */

VAMTIGER VAMTIGER Get Remote Stylesheet Paths can also be more conveniently referenced inside an async function.

const getRemoteStylesheetPaths = require('vamtiger-get-remote-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 remoteStylesheetLinks = await getRemoteStylesheetPaths({ html });
/* [
'https://remote/stylesheet/link/index.css'
] */
}

Current Tags

  • 0.0.3                                ...           latest (2 years ago)

2 Versions

  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |