New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

does-this-module-install

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

does-this-module-install

A starter package for typescript projects

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

does-this-module-install

npm license travis status Build status Coverage Status David David
NPM

npm enables creation of small modules to compose larger systems. One problem that surfaces is that smaller modules have to be tested for deployment.

A common cause of error is when a dependency is listed as a dev-dependency. This causes needless frustration - in ensuring all will work.

This module, provides a unit installation test as a function. The function is independent of test framework. It throws on error when installing it's root-parent module. Root parent is defined as the first subdirectory containing node_modules.

This module, provides a unit installation test, that tests an npm module can be self installed in production mode.

Installation

npm install does-this-module-install -D

or

yarn install doed-this-module-install --save-dev

Usage

runInstallTest is a simple function that detects the current parent-root module, uses it's relative path to install the module into a temp directory.

The function is independent of test framework and returns a success message or throws an error. Use shown below is tied to mocha, should be easy enough to modify as needed.

// somewhere in your tests
import { runInstallTest } from 'does-this-module-install

// demonstrated with mocha, but should be adaptable to
// any test framework of your choice
describe(`regular module tests`, () => {
  it(`install test`, async () => {
    expect(await runInstallTest()).to.match(/success! installing .*/);
  });
});

Code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

Apache-2.0

Support

Bugs, PRs, comments, suggestions welcomed!

Keywords

TypeScript

FAQs

Package last updated on 11 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