{"id":44141,"library":"winnow","title":"winnow","description":"Apply SQL-like filters to GeoJSON feature collections in memory or via streams. v2.6.0 is the last standalone release; development has moved to @koopjs/winnow in the Koop monorepo. Supports WHERE clauses, spatial predicates (ST_Within, ST_Contains, ST_Intersects), field selection, aggregations (sum, avg, count, max, min, first, last), group by, limit/offset, ordering, CRS reprojection, and Esri feature output. Ships TypeScript types.","status":"deprecated","version":"2.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/koopjs/winnow","tags":["javascript","geojson","filter","stream","sql","geoservices","query","typescript"],"install":[{"cmd":"npm install winnow","lang":"bash","label":"npm"},{"cmd":"yarn add winnow","lang":"bash","label":"yarn"},{"cmd":"pnpm add winnow","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Converts between GeoJSON and Esri geometry","package":"@terraformer/arcgis","optional":false},{"reason":"Spatial predicate operations","package":"@terraformer/spatial","optional":false},{"reason":"TopoJSON support","package":"topojson-client","optional":true}],"imports":[{"note":"Package is ESM-only; CommonJS require() will fail. Use dynamic import or switch to @koopjs/winnow.","wrong":"const winnow = require('winnow')","symbol":"default (winnow)","correct":"import winnow from 'winnow'"},{"note":"query is a named export, not a subpath export.","wrong":"import { query } from 'winnow/query'","symbol":"query","correct":"import { query } from 'winnow'"},{"note":"TypeScript types are included, but QueryOptions is a type, not a runtime value.","wrong":"const QueryOptions = require('winnow').QueryOptions","symbol":"TypeQueryOptions","correct":"import type { QueryOptions } from 'winnow'"}],"quickstart":{"code":"import winnow from 'winnow';\n\nconst features = {\n  type: 'FeatureCollection',\n  features: [\n    { type: 'Feature', properties: { name: 'a', value: 1 }, geometry: { type: 'Point', coordinates: [-118, 34] } },\n    { type: 'Feature', properties: { name: 'b', value: 2 }, geometry: { type: 'Point', coordinates: [-119, 35] } },\n    { type: 'Feature', properties: { name: 'c', value: 3 }, geometry: { type: 'Point', coordinates: [-120, 36] } }\n  ]\n};\n\nconst result = await winnow.query(features, {\n  where: \"value > 1\",\n  fields: ['name'],\n  order: ['name DESC']\n});\nconsole.log(result);\n// { type: 'FeatureCollection', features: [ { type: 'Feature', properties: { name: 'b' }, geometry: { type: 'Point', coordinates: [-119, 35] } }, { type: 'Feature', properties: { name: 'c' }, geometry: { type: 'Point', coordinates: [-120, 36] } } ] }","lang":"typescript","description":"Queries a GeoJSON FeatureCollection with a WHERE clause, field selection, and ordering, printing the filtered result."},"warnings":[{"fix":"npm uninstall winnow && npm install @koopjs/winnow and update imports to '@koopjs/winnow'.","message":"winnow is deprecated; use @koopjs/winnow from the Koop monorepo instead.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Use winnow.query(data, options) instead of instantiating Winnow.","message":"v2.0.0 changed the API from constructor-based to static methods. 'new Winnow()' no longer works.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use import or dynamic import(). For CommonJS projects, consider @koopjs/winnow which supports CJS.","message":"The package is ESM-only; require() throws 'ERR_MODULE_NOT_FOUND' or similar.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use 'outputCrs' instead of 'projection'.","message":"The 'projection' option was renamed to 'outputCrs' in v2.0.0. Using 'projection' is silently ignored.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use @terraformer/arcgis or esri-to-geojson packages for conversion.","message":"The 'toEsri' option will be removed in a future version.","severity":"deprecated","affected_versions":">=2.6.0"}],"env_vars":null,"search_vec":"'aggreg':44 'appli':2 'avg':46 'claus':33 'collect':10 'contain':39 'count':47 'crs':56 'develop':22 'esri':59 'featur':9,60 'field':42 'filter':6,67 'first':50 'geojson':8,66 'geoservic':70 'group':52 'intersect':41 'javascript':65 'koop':29 'koopjs/winnow':26 'last':19,51 'like':5 'limit/offset':54 'max':48 'memori':12 'min':49 'monorepo':30 'move':24 'order':55 'output':61 'predic':35 'queri':71 'releas':21 'reproject':57 'select':43 'ship':62 'spatial':34 'sql':4,69 'sql-like':3 'st':36,38,40 'standalon':20 'stream':15,68 'sum':45 'support':31 'type':64 'typescript':63,72 'v2.6.0':16 'via':14 'winnow':1 'within':37","created_at":"2026-06-05T17:03:10.488393+00:00","updated_at":"2026-06-05T17:03:10.488393+00:00","problems":[{"fix":"Use 'import winnow from \"winnow\"' or switch to @koopjs/winnow.","cause":"Trying to require() an ESM-only package in a CommonJS context.","error":"ERR_MODULE_NOT_FOUND: Cannot find module 'C:\\path\\to\\node_modules\\winnow\\dist\\node\\index.js' imported from ..."},{"fix":"Ensure correct import: `import winnow from 'winnow'`. Also check that winnow.query exists (v2+).","cause":"Using default import incorrectly, or trying to call a method on a namespace that is a class instance.","error":"TypeError: winnow.query is not a function"},{"fix":"Use one of the supported spatial predicates: ST_Within, ST_Contains, ST_Intersects, esriSpatialRelWithin, esriSpatialRelContains, esriSpatialRelIntersects.","cause":"Only ST_Within, ST_Contains, ST_Intersects (and Esri equivalents) are supported.","error":"Error: Invalid spatial predicate: esriSpatialRelTouches"},{"fix":"Use only supported aggregate types: 'sum', 'avg', 'count', 'max', 'min', 'first', 'last'.","cause":"Only sum, avg, count, max, min, first, last are supported.","error":"Error: Unknown aggregate type: 'median'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/koopjs/winnow#readme","github":"https://github.com/koopjs/winnow","docs":null,"changelog":null,"pypi":null,"npm":"winnow","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}