npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

formulasfrutalesestamcionanalytics

v1.0.2

Published

Paquete para calcular rendimiento distintas especies

Readme

formulasFrutalesEstamcionAnalytics

Paquete de Calculadoras de Rendimiento

Calculadoras puras (sin efectos secundarios) de métricas agronómicas para distintas especies frutales.
Cada clase consume una unidad productiva (productiveUnit) como única fuente de datos y no muta ese objeto: todos los métodos retornan number | null.

Incluye clases:

  • YieldCalculatorCherry
  • YieldCalculatorCherryPlum
  • YieldCalculatorPeach
  • YieldCalculatorNectarines
  • YieldCalculatorKiwi

Dependiendo de la clase instanciada serán las funciones disponibles.


Instalación

npm install @tu-org/formulas-frutales-estamcion-analytics

Uso rápido

const {
  Cerezo,
  Ciruelo,
  Ciruelo_Cherry_Plum,
  Duraznero,
  Nectarines,
  Kiwi,
} = require("formulas-frutales-estamcion-analytics");

const productiveUnit = {
  plantsHa: 1200,
  plantsHaProductive: 1100,
  surface: 10,
  pollinator: 12,
  flowersDart: 3.8,
  finalDartPostPoda: 220,
  caliberObjective: 26,
};

const yc = new Cerezo(productiveUnit);
console.log(yc.yieldObjective()); // Ejemplo de cálculo

Índice de clases y métodos principales

  • Cherry
    • flowersBudDartCalculate
    • flowersPlantPrePoda
    • flowersPlantPostPoda
    • twigObjective
    • flowersPlantObjective
    • flowersHaPrePoda
    • flowersHaPostPoda
    • flowersHaObjective
    • totalPlants
    • fruitsHaYield
    • fruitsPlantYield
    • fruitsSetRealPreRaleo
    • fruitsSetRealYield
    • fruitsSetReal
    • yieldEstimatePrePoda
    • yieldEstimatePostPoda
    • yieldObjective
    • yieldEstimateCounterFruits
    • yieldEstimateCounterFruitsPostRaleo
    • yieldEstimateCounterFruitsPreRaleo
    • yieldTotal
    • lastCounterType

(Los otros calculadores comparten estructura pero con funciones específicas según especie.)


Ejemplo en una API (Express)

const express = require("express");
const { Cerezo } = require("formulas-frutales-estamcion-analytics");

const app = express();
app.use(express.json());

app.post("/calculate/cherry", (req, res) => {
  const yc = new Cerezo(req.body);
  const result = {
    yieldObjective: yc.yieldObjective(),
    flowersHaPostPoda: yc.flowersHaPostPoda(),
    fruitsHaYield: yc.fruitsHaYield(),
  };
  res.json(result);
});

app.listen(3000, () => console.log("API running on http://localhost:3000"));

Ejemplo en React (Front-End)

import React, { useState } from "react";
import { Cerezo } from "formulas-frutales-estamcion-analytics";

export default function CalculatorForm() {
  const [plantsHa, setPlantsHa] = useState(1200);
  const [caliberObjective, setCaliberObjective] = useState(26);
  const [result, setResult] = useState(null);

  const handleCalculate = () => {
    const yc = new Cerezo({ plantsHa, caliberObjective });
    setResult(yc.yieldObjective());
  };

  return (
    <div>
      <h2>Calculadora de Cerezo</h2>
      <label>
        Plantas/Ha:
        <input
          type="number"
          value={plantsHa}
          onChange={(e) => setPlantsHa(Number(e.target.value))}
        />
      </label>
      <label>
        Calibre Objetivo:
        <input
          type="number"
          value={caliberObjective}
          onChange={(e) => setCaliberObjective(Number(e.target.value))}
        />
      </label>
      <button onClick={handleCalculate}>Calcular</button>
      {result && <p>Yield Objective: {result}</p>}
    </div>
  );
}

Notas

  • Cada función valida entradas (null, undefined, strings vacíos) antes de calcular.
  • Si los datos de entrada no son válidos → retorna null.
  • No depende de MongoDB ni de otra base de datos: todo se calcula en memoria a partir de productiveUnit.