Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
third-partay.js
Advanced tools
A tiny library that loads and manages external third-party JavaScript snippets.
A tiny library that loads and manages external third-party JavaScript snippets.
Sometimes you need to include a vendor's third party "cut and paste" JavaScript snippet in your project. ThirdPartay is a tiny, dependency-free library that gives you basic loading, management, and callback capabilities (via ES6 promises) over those unruly snippets. With ThirdPartay, you can bridge the gap between your own code and external vendor-provided scripts.
To use ThirdPartay, you'll need a modern JavaScript workflow and build system with ES6 module bundling and transpiling capabilities. Here's a great example. ThirdPartay makes use of ES6 promises, which are supported in modern browsers. To support older browsers, you might need to polyfill.
Install ThirdPartay via NPM and add to your dependencies:
$ npm install third-partay.js --save
Import the ThirdPartay module, then instantiate it. The constructor takes an optional selector argument, this is the selector to which your third party scripts will be appended. The default document.body should be fine in most cases.
// import ThirdPartay
import ThirdPartay from 'third-partay.js'
// create an instance
const Party = new ThirdPartay()
Each instance represents a group of external scripts. You can add as many scripts to an instance as you'd like.
Party.add('//cdn.urltoyourvendorsscript.com/script.js')
Party.add('//static.urltoanothervendorsscript.com/script.js')
Each instance returns a promise when all member scripts are loaded, allowing you to create intelligent groups of third party snippets with asynchronous promise-driven callbacks. Add a callback function to your instance to execute it once all of the instances scripts have been loaded.
Party.loaded((returned) => {
console.log(returned);
});
MIT. © 2016 Donny West
FAQs
A tiny library that loads and manages external third-party JavaScript snippets.
We found that third-partay.js 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.