question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support modularized NPM packages

See original GitHub issue

When I require lodash in my projects, I rarely want to use the whole library but I just install the modularized methods like lodash.shuffle, lodash.clonedeep

However in this case flow-typed can’t find definitions for those packages so either I have to:

  • npm install the whole library so that flow-typed can install the definitions automagically, or
  • explicitly flow-typed install lodash@... manually every time, which is bad

I actually wouldn’t mind having the whole definition file in my project, since it’s gitignored but I would like flow-typed to somehow recognize a modularized package is being used. This is of course not directly related to lodash but to any library that supports this modularization.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AndrewSouthpawcommented, Jul 13, 2018

I’m gonna go with “no” on this solution, because it would be a maintenance nightmare, unless there was supporting code to automatically copy the types into the modularized folders.

0reactions
Brianzchencommented, Jul 25, 2022

^ Follow example Pr above if anyone wants to add subset packages

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating Node.js modules - npm Docs
To create a package.json file, on the command line, in the root directory of your Node.js module, run npm init : · Provide...
Read more >
How Modular Programming Works in Node.js - freeCodeCamp
With Node's modular functionality, we can import our own external files, core (Native) node modules, and NPM modules. In this article, we'll ...
Read more >
40 Useful NPM Packages for Node.js Apps in 2021 - LeanyLabs
Overview of popular NPM packages for Node.js backend development. ... V3 has a modular architecture with a separate package for each service.
Read more >
The Basics of Modular JavaScript & npm Packages - Travis Horn
The Basics of Modular JavaScript & npm Packages · Installing Git (on Windows) · Installing Node.js (on Windows) · Using npm packages in...
Read more >
Build modular application with npm local modules - Medium
npm supports a variety of ways to declare module dependencies, the least known being the local one. Using local modules, here is what...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found