Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@harvest-profit/harvest-profit-calculations
Advanced tools
You will need an NPM access token to access this repo.
Simply run the following to install:
yarn add @harvest-profit/harvest-profit-calculations
To use this package, just give it a try!
import { Contract } from '@harvest-profit/harvest-profit-calculations';
const contractUrl = Contract.translateContractTypeToUrl(Contract.hedgeToArriveType);
console.log(contractUrl); // Outputs: `hedge_to_arrive`
This package is meant to standardize and document all the calculations used in the Harvest Profit App. The Calculations
module is a good example of that. That module contains very simple functions like calculateAvgCashPrice
which simply divides revenue by sold production, but each function documents on how to get that number which is important. If you are new to the project, that would be a good place to start reading some documentation.
As for standardizing, the Contract
module is a good example of that. You should NEVER be checking what type the contract is, or setting the contract type without using the module defined types. Example:
// Example of BAD
if (contract.type_name === 'cashsale') {
// ... do something
}
// Example of GOOD
if (contract.type_name === Contract.cashSaleType) {
// ... do something
}
Or better yet...
// Example of GOOD
if (Contract.isCashSaleType(contract.type_name)) {
// ... do something
}
Clone this repo, and begin committing changes. PRs are preferred over committing directly to master.
To run tests locally on your machine, run the following:
yarn run test
To preview documentation locally on your machine, run the following:
yarn run build-docs
After merging your pull request, consider updating the documentation with the following command:
yarn run publish-docs
This package is published as a Private NPM Module.
To publish to the private NPM registry, simply run the following, after bumping the package.json
version:
# Publish using Yarn
yarn publish
# Or publish using NPM
npm publish
Copyright 2017-Present Harvest Profit. This repo contains private code. No copying or external use permitted.
FAQs
All the calculations
The npm package @harvest-profit/harvest-profit-calculations receives a total of 61 weekly downloads. As such, @harvest-profit/harvest-profit-calculations popularity was classified as not popular.
We found that @harvest-profit/harvest-profit-calculations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.