0.0.8 • Published 6 months ago

@gurucore/finance v0.0.8

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
6 months ago

@gurucore/finance: common (public) financial funcs for both Serverside and Clientside

Install

run npm i @gurucore/finance

Notable Dependencies

  • gachchan
  • Fully TypeScript
  • Use Parcel to build

Peers

  • lodash
  • decimal.js

Sponsors

https://github.com/sponsors/lockevn


To publish/release

  • change package.json version string
  • (Optional) run in local those commands npm run ci and npm run release to build the output package (to test)
  • Create git tag and publish the git tag

npm version npm downloads


Development

TECH NOTE: How we setup Deps

This lib @gurucore/finance use _intersection from 'lodash/intersection' to import function from lodash

  • _intersection will not be bundled into @gurucore/finance by default. When you write import \_intersection from 'lodash/intersection', it creates a dependency that expects lodash to be available at runtime.

  • Specify "peerDependencies": { "lodash": "^4.17.21" }​ in @gurucore/finance.

    You're using lodash but want to allow the consuming project to control the lodash version It prevents multiple copies of lodash in the final application It makes it clear to users of @gurucore/finance that they need to install lodash

  • Do tts-wallet (which use gurucore-finance) need to depend on lodash?

    • Yes, tts-wallet needs to install lodash as a direct dependency because:
    • It's a peer dependency of @gurucore/finance The import statements in @gurucore/finance expect to find lodash in node_modules
    • If tts-wallet doesn't install lodash, you'll get runtime errors about missing modules

TECH NOTE: build with Parcel