New:Socket for Asana Is Now Available.Learn more
Get Started

@cropgraph/core

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cropgraph/core

CropGraph core library: curated crop calendar (1,000 entries), companion planting relationships, USDA hardiness zone lookup, and climate classification. Offline, zero network calls.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
95
10.47%
Maintainers
1
Weekly downloads
 
Created
Source

@cropgraph/core

Curated agricultural intelligence as a pure TypeScript library. No network calls, no API keys, no runtime dependencies beyond Zod.

What's in here

AssetDetail
Crop calendar1,000 entries: 319 vegetables, 186 herbs, 173 fruits, 163 flowers, 59 legumes, 55 cover crops, 45 roots. Frost-anchored planting windows with optional climate modifiers for six climate types.
Companion planting121 directed relationships: 88 beneficial, 33 antagonist, 12 mechanism categories (nitrogen_fixing, pest_repellent, trap_crop, ...).
USDA hardiness zones40,283 ZIP-code centroids from PRISM 2023 + waldoj/frostline, with offline lookup by coordinates or ZIP. Frost-date table by zone.
Climate typesSix-type classifier (maritime, mediterranean, continental, humid_subtropical, arid, semi_arid) from a coordinate-based heuristic.

All datasets are validated against JSON Schemas at module load. A malformed fixture breaks import "@cropgraph/core" immediately rather than at runtime.

Install

npm install @cropgraph/core

Usage

import {
  getHardinessZone,
  getClimateType,
  getPlantingPlan,
  findCrop,
  searchCrops,
  getCompanions,
  checkCompanionPair,
} from "@cropgraph/core";

// Zone lookup from coords.
const zone = getHardinessZone({ lat: 48.118, lng: -123.43 });
// → { ok: true, data: { zone: "8b", ... } }

// Climate classification from coords.
const climate = getClimateType({ lat: 48.118, lng: -123.43 });
// → { ok: true, data: { climateType: "maritime", ... } }

// Planting plan for a zone.
const plan = getPlantingPlan({ zone: "8b", climateType: "maritime" });
// → { ok: true, data: { plantNow: [ ... ] } }

// Crop lookup.
findCrop("tomato");
searchCrops("squash");

// Companion planting.
getCompanions("tomato");                // 18 entries for tomato
checkCompanionPair("tomato", "basil");  // beneficial

Data sources

Every entry cites a USDA Cooperative Extension publication or a peer-reviewed source. See the per-entry source field in src/data/crop-calendar.json and src/data/companions.json, and the file-level descriptions in the matching *.schema.json files for the methodology rundown.

License

MIT.

Keywords

cropgraph

FAQs

Package last updated on 13 May 2026

Related posts