title: js - how to import functions from the @turf/meta module
body: <p>I am trying to import a function named <code>coordEach</code> from the npm module <code>@turf/meta</code>. I tried using import and desturctoring the function, but I am getting this error:</p>
  
  <blockquote>
    <p>Uncaught (in promise) TypeError: Object(...) is not a function</p>
  </blockquote>
  
  <p>my code:</p>
  
  <pre><code>import { coordEach } from "@turf/meta";
  
  export const morphGeoJSON = (feature, bbox, width, height) =&gt; {
    coordEach(
      feature,
      (
        currentCoords,
        coordIndex,
        featureIndex,
        multiFeatureIndex,
        geometryIndex
      ) =&gt; {
        debugger;
      }
    );
  
    return feature;
  };
  </code></pre>
  
  <p>as far as I can tell I am importing everything from the <a href="https://github.com/Turfjs/turf/blob/master/packages/turf-meta/index.mjs" rel="nofollow noreferrer">package</a> correctly. The npm install is also ok.</p>
  
  <p>What am I missing?</p>
  
  <p>I also tried</p>
  
  <pre><code>import turfMeta from "@turf/meta"
  
  turfMeta.coordEach(feature, () =&gt; {debugger})
  </code></pre>
  
  <p>The error there is:</p>
  
  <blockquote>
    <p>Unhandled Rejection (TypeError):
    __WEBPACK_IMPORTED_MODULE_0__turf_meta___default.a.coordEach is not a function</p>
  </blockquote>