Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A lightweight promise based package to load scripts on the fly.
# Using npm
$ npm install get-js --save
# Using Yarn
$ yarn add get-js
# Using Bower
$ bower install get-js --save
You'll also need a Promise polyfill for older browsers.
$ npm install es6-promise
Include the package using Common JS require()
or ES2015 import
:
var get = require('get-js');
// ES2015+
import get from 'get-js';
Or, using <script>
tags:
<script type="text/javascript" src="/path/to/get-js/dist/get.min.js"></script>
Here you go:
// Load single script
get('https://code.jquery.com/jquery-2.2.3.min.js').then(function() {
console.log('do something');
});
// Load multiple scripts, without changing the order
get([
'/js/abc.js',
'/js/xyz.js'
]).then(function() {
console.log('do something now');
}).catch(function() {
console.log('error');
});
You can also inject this in your angular files as a $q
friendly angular service.
Require the angular module using
var angularGetJs = require('get-js/angular');
Or
<script type="text/javascript" src="/path/to/get-js/dist/angular-get.min.js"></script>
Then you should be able to use it like this
// Add the module as a dependeny in your app
angular.module('app', ['angularGetJs']);
// Inject the service
angular.module('app')
.controller('MyController', ['get', function(get) {
get('/some/script.js')
.then(function() {
console.log('do something now');
})
.catch(function() {
console.log('error');
});
}]);
FAQs
A lightweight library to asynchronously load scripts on the fly.
The npm package get-js receives a total of 83 weekly downloads. As such, get-js popularity was classified as not popular.
We found that get-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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.