How to structure node library with multiple entry points?

129
June 07, 2019, at 11:40 PM

I've got a library that has multiple entry points:

  • Requirements
  • DefaultRequirements
  • GlobalConfiguration

The first is meant to be instantiated multiple times. The latter two are singletons.

This library targets both node and web browsers so placed files in the following folders:

/node_modules/@cowwoc/requirements    
  /node    
  /browser

Is it possible to have users import "@cowwoc/requirements/DefaultRequirements" without having to specify that the actual file is under node or browser?

READ ALSO
How to query password from an LDAP and use it with passport.js

How to query password from an LDAP and use it with passport.js

I have a nodejs application that uses passport

101
How to call SerializeUser manually in passport.js?

How to call SerializeUser manually in passport.js?

I'm on a quest to update user's sessions when their user document is modified by someone other than them

129
Electron setProxy() and fromPartition() not working

Electron setProxy() and fromPartition() not working

I am trying to build a program where each new BrowserWindow has its own proxy to go with itThe issue is that whenever I use window

165
Decoding Base64 pdf giving broken file

Decoding Base64 pdf giving broken file

Can someone please explain why decoding Base64 giving a broken pdf? I need to find the way how to decode Base64 and get pdf outWhen i use this service

126