Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Simple library to easily switch between local and CDN libraries.
Just run
$ npm install -g cdnify
You just need to add the cdn
attributes with the URL
pointing to the CDN you want to get started.
For example, let say the following file is called index.html
.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Foobar</title>
<script src="js/foo.js" cdn="//mycdn.com/bar.js"></script>
<link href="css/foo.css" cdn="//mycdn.com/bar.css">
</head>
<body>
</body>
</html>
By running
$ cdnify index.html -o dist/index.html
You will get
<script src="//mycdn.com/bar.js"></script>
<link href="//mycdn.com/bar.css">
in dist/index.html
.
If you want to keep the local source, pass the --use-local
flag.
--output
(aliased: -o
): Set the output. Uses stdout if not set.--use-local
(default: false
): Uses local file (set by src
or href
) instead of cdn
--incompatible
(aliased: -i
, default: []
): Set a list of attributes incompatible with cdn
. If used together, an error will return.--cdn-attr
(aliased: t
, default: cdn
): Set the attribute to be used for the CDN source.Sample command:
$ cdnify -o foo.html --use-local -i glob -i other-attr --cdn-attr custom-attr
This module exposes two functions:
cdnify.process(rawHtml, options, callback)
Arguments:
rawHtml
: The raw HTML to process
options
: The options as specified for the CLI. camelCase can be used instead of dash separated words.
callback
: The callback to be called when done. The callback has the form:
function (err, html, $) {
}
where html
is the processed HTML as a string and $
is an instance
of cheerio, in case more processing
is needed.
cdnify.processFile(filepath, options, callback)
Excatly the same function as above, except that the first
argument is the path to the HTML file to proces, instead of the raw HTML.
FAQs
CLI tool and library to use CDN in production
We found that cdnify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.