Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chop-chop

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chop-chop

Load styles/scripts synchronously (or asynchronously) via HTML 'preload'.

  • 0.0.8
  • unpublished
  • rc
  • dev
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Chop-Chop

Load styles/scripts synchronously (or asynchronously) via HTML 'preload'.

npm overview
latest version license browser script size typescript/js open issues
greenkeeper dependency status follow on twitter follow on github fork

developed by ‹src.works/›

Harness the power of <link rel="preload"> in Chrome and other modern browsers. This library provides a useful set of utilities that can be used to preload styles and scripts, then load them in order, or just load them straight away — synchronously or asynchronously. To learn more, see: Preload: What Is It Good For? & Chop-Chop Docs.

Installation Options

Install via NPM package

$ npm install chop-chop --save;

Or install via Yarn Yarn package

$ yarn add chop-chop;

Or install via unpkg.com CDN CDN

<script src="https://unpkg.com/chop-chop@0.0.8" integrity="sha384-nihFIupLpAen2KgO9BtVN6LcFYEJ0FwRmh9waYwopvof5L0CX6rzF3ikQZSbdcp9" crossorigin="anonymous"></script>

Works in All Modern Browsers

Browsers

If you need to support IE <= 11 (prior to Edge), older versions of Android, and much older versions of other browsers, you can insert this polyfill before all other script tags. The polyfill.io service fills ES6 features that a user's browser is lacking, based on both UA & feature detection.

<!-- Before ALL other script tags in your document. -->
<!-- Only needed if you want to support much older browsers. -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6&amp;flags=gated"></script>

Quick Example

<script>
  chopChop.preloadThenLoad([
    'https://example.com/styles-a.css',
    'https://example.com/scripts-a.js',

    'https://example.com/styles-b.css',
    'https://example.com/scripts-b.js',

    'https://example.com/styles-c.css',
    'https://example.com/scripts-c.js',
  ])
    .then(function(urls) {
      console.log('Resources loaded in the order given: %o', urls);
    });
</script>

More Examples / Documentation

Built with TypeScript/JavaScript, Babel, NodeJS, NPM, and Sass

Commercial Use

@jaswrks

This software is created, documented and maintained by Jason Caldwell (@jaswrks) and a small team of talented developers at ‹src.works/›. It's open source, but if you use it commercially, please pay what you can.

Development Channels

Always use the latest stable version in production. If you want upcoming changes ahead of time use the @dev or @rc tag, but please do so at your own risk. The @dev and @rc tags are potentially unstable at various times throughout a development cycle, and therefore should not be used in production.

ChannelNPM TagDescriptionSemVerGitHub
Hackers@devLatest Bleeding Edge
potentially-unstable
Release Tagmaster (PRs)
Lab Rats@rcNext Release Candidate
upcoming semi-stable release
Release Tagreleases
Everyone@latestLatest Stable Version
highly recommended
Release Tagreleases

NPM Consumption Examples

ChannelNPM TagNPM package.json
Hackers@dev"chop-chop": "dev"
Lab Rats@rc"chop-chop": "rc"
Everyone@latest"chop-chop": "latest"
Latest Stable Version"chop-chop": "^0.0.8"
ChannelNPM TagNPM Install
Hackers@devnpm install chop-chop@dev
Lab Rats@rcnpm install chop-chop@rc
Everyone@latestnpm install chop-chop@latest
Latest Stable Versionnpm install chop-chop

CDN Directory Indexes

ChannelNPM TagCDN Distribution Index
Hackers@devhttps://unpkg.com/chop-chop@dev/dist/
Lab Rats@rchttps://unpkg.com/chop-chop@rc/dist/
Everyone@latesthttps://unpkg.com/chop-chop@latest/dist/
Latest Stable Versionhttps://unpkg.com/chop-chop@0.0.8/dist/

CDN Script URLs

ChannelNPM TagCDN Script URL
Hackers@devhttps://unpkg.com/chop-chop@dev
Lab Rats@rchttps://unpkg.com/chop-chop@rc
Everyone@latesthttps://unpkg.com/chop-chop@latest
Latest Stable Versionhttps://unpkg.com/chop-chop@0.0.8
CDN In production, use the latest stable version with an SRI integrity hash.
<script src="https://unpkg.com/chop-chop@0.0.8" integrity="sha384-nihFIupLpAen2KgO9BtVN6LcFYEJ0FwRmh9waYwopvof5L0CX6rzF3ikQZSbdcp9" crossorigin="anonymous"></script>

Tip: Don't use an SRI hash with a tag like @dev, @rc, or @latest. Tags reference a version dynamically; e.g., the @latest tag will point to an updated copy once the next version is released — rendering the SRI invalid. Instead, use a specific @x.x.x version in the URL.

MIT License

For full details see: LICENSE.txt

Changelog

For full details see: CHANGELOG.md

Semantic Versioning

New versions are released following semver.org guidelines.

Pull Requests Welcome

fork the master branch at GitHub and submit your changes for review.

Lab Rats Subscribe

FAQs

Package last updated on 14 Aug 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc