Skip to content
JS
Comparison

rewire vs ng-mocks

TestingPackage data 25 Sept 2026
rewirev9.0.1, 15 Aug 2025

Easy dependency injection for node.js unit testing

$ npm install rewire
ng-mocksv14.18.1, 18 Sept 2026

ng-mocks simplifies Angular testing with mock dependencies, shallow rendering and less boilerplate. Mock components, services, directives, pipes and modules in Angular 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 with Jasmine, Jest or Vitest.

$ npm install ng-mocks
Metricrewireng-mocksDifference
Weekly downloads509,192404,583rewire +26%
12-month download growth+16%-0%rewire +16 pts
Gzip size---
Minified size---
Dependencies20rewire 2 more
Unpacked size24 kB2.1 MBrewire 90.2x smaller
Latest release9.0.1, 15 Aug 202514.18.1, 18 Sept 2026ng-mocks 13 months more recent
Releases, last 12 months016ng-mocks 16 more
First published4 Jun 201210 Feb 2018rewire 5.7 years earlier
GitHub stars3,0901,159rewire 2.7x higher
Open issues4815rewire 33 more
Open pull requests345ng-mocks 42 more
Contributors---
Commits, last 52 weeks22,615ng-mocks 1307.5x higher
TypeScript typesNoneBundledDiffers
Module formatCommonJSESM + CommonJSDiffers
Runtimes---
LicenseMITMITSame

Green marks the smaller size or the more recent release. Bold marks the higher count, with no judgement implied. Sizes are for the whole package per Bundlephobia. Growth compares the average of the last 4 weeks with the first 4 weeks of the 52-week series.

rewire509.2k latest weekng-mocks404.6k latest week
Week of 23 Sept 2025Week of 15 Sept 2026
Weekly npm downloads, 52 weeks. Y axis starts at zero. Values are not smoothed.

rewire

Major versions
  1. 0.1.04 Jun 2012
  2. 1.0.020 Aug 2012
  3. 2.0.030 Sept 2013
  4. 3.0.011 Nov 2017
  5. 4.0.09 Apr 2018
  6. 5.0.011 Mar 2020
  7. 6.0.019 Dec 2021
  8. 7.0.013 Aug 2023
  9. 8.0.03 Jun 2025
  10. 9.0.08 Jul 2025
Last 5 releases
  1. 9.0.115 Aug 2025
  2. 9.0.08 Jul 2025
  3. 8.0.03 Jun 2025
  4. 7.0.013 Aug 2023
  5. 6.0.019 Dec 2021
48 releases in total, 0 in the last 12 months

ng-mocks

Major versions
  1. 5.0.025 Mar 2018
  2. 6.0.014 May 2018
  3. 7.0.026 Oct 2018
  4. 8.0.03 Jun 2019
  5. 9.0.011 Feb 2020
  6. 10.0.05 Jul 2020
  7. 11.0.015 Nov 2020
  8. 12.0.013 May 2021
  9. 13.0.023 Jan 2022
  10. 14.0.018 Jun 2022
Last 5 releases
  1. 14.18.118 Sept 2026
  2. 14.18.015 Sept 2026
  3. 14.17.610 Sept 2026
  4. 14.17.56 Sept 2026
  5. 14.17.45 Sept 2026
169 releases in total, 16 in the last 12 months
rewire

-

ng-mocks

-

rewire

-

ng-mocks

-

  • Need no runtime dependenciesng-mocks (rewire has 2, ng-mocks has 0)
  • Need both ESM and CommonJS entry pointsng-mocks (rewire: CommonJS; ng-mocks: ESM + CommonJS)
  • Need to load it with require()Both
  • Need TypeScript types in the package itselfng-mocks (rewire: None; ng-mocks: Bundled)
  • Need the more recent releaseng-mocks (14.18.1 on 18 Sept 2026 vs 9.0.1 on 15 Aug 2025)
  • Higher weekly npm downloadsrewire (509.2k vs 404.6k)

Each line is generated from the data above.

rewire: rewire npm registry, rewire npm downloads, rewire GitHub. Data fetched 25 Sept 2026.
ng-mocks: ng-mocks npm registry, ng-mocks npm downloads, ng-mocks GitHub. Data fetched 25 Sept 2026.

Indexability: Indexed.