Giter Club home page Giter Club logo

node-safestart's Introduction

Safe start

Checks if your dependencies are valid. Or throws an Error.

Usage / Examples

var safestart = require('safestart')

safestart(__dirname) // throws an Error on failure

// you can exclude particular libraries, e.g. if you've installed
// `foo` from a fork on GitHub, causing a version mismatch
safestart(__dirname, {
  exclude: ['foo']
})

Can also be used commandline:

safestart

Development

When developing, be sure to test the package and also check the dependencies are free of CVEs.

npm run test
npm run scan_packages

License

Open source software under the zlib license.

node-safestart's People

Contributors

defunctzombie avatar marcello3d avatar prust avatar rich-harris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-safestart's Issues

Needs to handle versions with leading 0s

See issue here:

facebook/react#2811

tl;dr

An app requires a package version that reads 7001.0001.0000 but when npm downloads the package, it will cache the package as 7001.1.0 (which will also imprint the version field in the package's package.json as 7001.1.0 instead of 7001.0001.0000) resulting in a mismatch.

.git is optional in NPM

Looks like this will install in npm:

git://github.com/lapwinglabs/x-ray#058b096f

but safestart expects:

git://github.com/lapwinglabs/x-ray.git#058b096f30493b30588b62d1ff48b241628e94ed

Once the .git suffix is added, it works fine. Not sure if this is a common case, but it took me a bit to figure out.

Modules installed from github fail

If I install a package from github, like

npm i -S Rich-Harris/regl#es-modules

then I get the following mismatch error:

expected: github:rich-harris/regl#es-modules, got: rich-harris/regl#es-modules

Changing index.js like this seems to work, but maybe I've misunderstood the problem?

- expectedVersion = expectedVersion.replace(/^git\+https/, 'git')
+ expectedVersion = expectedVersion.replace(/^git\+https/, 'git').replace('github:', '')

[dev|peer]Dependencies

Would be great if this checked devDependencies and maybe peerDependencies - that way you could include this in build config files.

Probably makes sense for it to be an option rather than the default, e.g

require( 'safestart' )( __dirname, { dev: true });

If I get time this week I'll try and send a PR, if you don't beat me to it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.