{"id":25178,"library":"doiuse-email","title":"doiuse-email","description":"Lint CSS and HTML for email client support against the Can I Email database. v0.4.1 is the latest stable release, with slow release cadence. Key differentiators: programmatic API and CLI, TypeScript types included, supports flexible client selection via glob patterns. Unlike other tools, it uses the same data source as caniemail.com and is inspired by doiuse for web browser support.","status":"active","version":"0.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/leondreamed/doiuse-email","tags":["javascript","lint","html","css","doiuse","email","gmail","support","caniuse","typescript"],"install":[{"cmd":"npm install doiuse-email","lang":"bash","label":"npm"},{"cmd":"yarn add doiuse-email","lang":"bash","label":"yarn"},{"cmd":"pnpm add doiuse-email","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for parsing CSS within HTML","package":"postcss","optional":false},{"reason":"Core linting logic adapted for email","package":"doiuse","optional":false},{"reason":"Glob matching for email client selection","package":"micromatch","optional":false}],"imports":[{"note":"ESM-only. TypeScript types are bundled.","wrong":"const doIUseEmail = require('doiuse-email')","symbol":"doIUseEmail","correct":"import { doIUseEmail } from 'doiuse-email'"},{"note":"Type import, available in TypeScript.","wrong":"none","symbol":"DoIUseOptions","correct":"import { DoIUseOptions } from 'doiuse-email'"},{"note":"Result type for the return value.","wrong":null,"symbol":"DoIUseResult","correct":"import { DoIUseResult } from 'doiuse-email'"}],"quickstart":{"code":"import { doIUseEmail } from 'doiuse-email';\n\nconst html = `\n<!DOCTYPE html>\n<html>\n  <body>\n    <div style=\"background-color: orange;\"></div>\n  </body>\n</html>\n`;\n\nconst result = doIUseEmail(html, {\n  emailClients: ['gmail.*'],\n});\n\nconsole.log(result.success);\n// true if no unsupported features, false otherwise\nconsole.log(result.notes);\n// Array of notes about support status per client","lang":"typescript","description":"Shows how to lint HTML for Gmail support using the programmatic API."},"warnings":[{"fix":"Upgrade Node.js to 12+ or use an older version of this package if needed.","message":"Requires Node.js 12 or later. Older Node versions cause errors.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use import { doIUseEmail } from 'doiuse-email' instead of import doiuse from 'doiuse-email'.","message":"The default export is deprecated in favor of named export 'doIUseEmail'.","severity":"deprecated","affected_versions":"0.3.x"},{"fix":"Update scripts that parse CLI output to expect an array of note objects instead of the previous object shape.","message":"CLI output format changed from an object with 'success' and 'notes' to a flat JSON array in v0.4.0.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Ensure all CSS is inline within the HTML string passed to doIUseEmail.","message":"Only inline CSS is supported; external stylesheets are not checked.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install doiuse-email'. Use 'import { doIUseEmail } from 'doiuse-email' instead of require.","cause":"Package not installed or import path is wrong (e.g., using require in ESM-only package).","error":"Error: Cannot find module 'doiuse-email'"},{"fix":"Change 'import doiuse from 'doiuse-email'' to 'import { doIUseEmail } from 'doiuse-email''.","cause":"Using default import incorrectly. The package only exports named exports.","error":"TypeError: doIUseEmail is not a function"},{"fix":"Use ES module import syntax. Alternatively, set 'type': 'module' in package.json or use .mjs extension.","cause":"Using CommonJS require in an ESM-only package.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}