
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
jsdom-angularjs
Advanced tools
Enables angular in Node.js
jsdom-angularjs will inject angular into your Node.js environment. Useful for running, in Node.js, tests that are made for browsers.
Requires jsdom.
npm install --save-dev --save-exact jsdom jsdom-angularjs
jsdom-angularjs now requires jsdom v10 or above.
Just invoke it to turn your Node.js environment into a DOM environment.
require('jsdom-angularjs')()
// you can now use the DOM
let controller = angular.module('module').controller('controller')
To clean up after itself, just invoke the function it returns.
var cleanup = require('jsdom-angularjs')()
// do things
cleanup()
In tape, run it before your other tests.
require('jsdom-angularjs')()
test('your tests', (t) => {
/* and so on... */
})
Simple: Use Mocha's --require option. Add this to the test/mocha.opts file (create it if it doesn't exist)
-r jsdom-angularjs/register
Advanced: For finer control, you can instead add it via mocha's before and after hooks.
before(function () {
this.jsdomAngularJS = require('jsdom-angularjs')()
})
after(function () {
this.jsdomAngularJS()
})
If you prefer to use import rather than require, you might want to use jsdom-global/register instead. Place it on top of your other import calls.
import 'jsdom-angularjs/register'
// ...
jsdom-angularjs © 2019+, Igo Ventura. Released under the [MIT] License.
GitHub @igoventura · Twitter @igoventura
FAQs
> Enables angular in Node.js
We found that jsdom-angularjs 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.