{
  "name": "string-length",
  "url": "https://canirequire.com/package/string-length/",
  "description": "Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes",
  "latest": "7.0.1",
  "latestPublished": "2026-01-21T14:39:13.979Z",
  "format": "esm-only",
  "summary": "string-length@7.0.1 is ESM-only. string-length dropped its CommonJS build in 5.0.0 (June 2021). The last version you can require() on every Node.js version, including 18 and older, is 4.0.2, published Mar 17, 2021. On Node.js 20.19+, 22.12+ and every newer release, require(\"string-length\") works anyway: Node can load synchronous ES modules through require(). Verified on Node 20, 22, 24, 26. Node.js 18 and older still fail with ERR_REQUIRE_ESM. string-length@7.0.1 declares engines \">=20\", so Node.js 18 is outside its supported range regardless of module format.",
  "esmOnlySince": "5.0.0",
  "esmOnlySinceDate": "2021-06-05T14:53:05.037Z",
  "lastCommonJsVersion": "4.0.2",
  "lastCommonJsDate": "2021-03-17T06:47:19.439Z",
  "nativeEsmSince": "5.0.0",
  "types": "bundled",
  "nodeEngines": ">=20",
  "deprecated": null,
  "license": "MIT",
  "repository": "https://github.com/sindresorhus/string-length",
  "weeklyDownloads": 46580842,
  "runtime": {
    "verifiedAt": "2026-09-09T15:28:18.955Z",
    "node": {
      "18": {
        "require": false,
        "import": true,
        "requireError": "ERR_REQUIRE_ESM",
        "importError": null
      },
      "20": {
        "require": true,
        "import": true,
        "requireError": null,
        "importError": null
      },
      "22": {
        "require": true,
        "import": true,
        "requireError": null,
        "importError": null
      },
      "24": {
        "require": true,
        "import": true,
        "requireError": null,
        "importError": null
      },
      "26": {
        "require": true,
        "import": true,
        "requireError": null,
        "importError": null
      }
    },
    "bun": {
      "require": true,
      "import": true,
      "requireError": null,
      "importError": null
    }
  },
  "formatHistory": [
    {
      "version": "7.0.1",
      "format": "esm-only",
      "published": "2026-01-21T14:39:13.979Z"
    },
    {
      "version": "7.0.0",
      "format": "esm-only",
      "published": "2026-01-21T02:53:46.773Z"
    },
    {
      "version": "6.0.0",
      "format": "esm-only",
      "published": "2023-06-04T08:35:56.366Z"
    },
    {
      "version": "5.0.1",
      "format": "esm-only",
      "published": "2021-09-13T18:20:51.093Z"
    },
    {
      "version": "5.0.0",
      "format": "esm-only",
      "published": "2021-06-05T14:53:05.037Z"
    },
    {
      "version": "4.0.2",
      "format": "cjs",
      "published": "2021-03-17T06:47:19.439Z"
    },
    {
      "version": "4.0.1",
      "format": "cjs",
      "published": "2020-03-19T16:38:12.544Z"
    },
    {
      "version": "4.0.0",
      "format": "cjs",
      "published": "2020-02-21T10:58:55.900Z"
    },
    {
      "version": "3.1.0",
      "format": "cjs",
      "published": "2019-04-02T02:35:54.651Z"
    },
    {
      "version": "3.0.0",
      "format": "cjs",
      "published": "2019-03-18T08:14:18.073Z"
    },
    {
      "version": "2.0.0",
      "format": "cjs",
      "published": "2017-07-27T01:03:51.257Z"
    },
    {
      "version": "1.0.1",
      "format": "cjs",
      "published": "2015-07-16T21:16:09.833Z"
    },
    {
      "version": "1.0.0",
      "format": "cjs",
      "published": "2014-08-13T13:37:13.130Z"
    },
    {
      "version": "0.1.2",
      "format": "cjs",
      "published": "2014-05-01T21:49:01.365Z"
    },
    {
      "version": "0.1.1",
      "format": "cjs",
      "published": "2014-04-30T22:51:26.244Z"
    },
    {
      "version": "0.1.0",
      "format": "cjs",
      "published": "2014-04-16T21:49:45.503Z"
    }
  ]
}