{"id":12799,"library":"allure-store","title":"Allure Store","description":"allure-store provides a flexible and extensible data store for interacting with Allure test results. It offers a unified API, the AllureStore, to read, write, and transform various Allure data entities like test results, containers, categories, environment information, and executor details. The library supports reading from traditional `allure-results` directories, as well as compiled Allure2 reports (local directories, HTML files, or HTTP/HTTPS URLs), and allows writing data back. It is currently at version 1.2.0, with a relatively active release cadence since its initial release in late 2024, focusing on feature enhancements and bug fixes. Key differentiators include its pluggable `AllureReader` and `AllureWriter` interfaces, enabling custom storage backends and result aggregation capabilities, making it highly adaptable for CI/CD pipelines or custom reporting tools.","status":"active","version":"1.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/wix-incubator/allure-store","tags":["javascript","allure","typescript"],"install":[{"cmd":"npm install allure-store","lang":"bash","label":"npm"},{"cmd":"yarn add allure-store","lang":"bash","label":"yarn"},{"cmd":"pnpm add allure-store","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Primarily designed for ESM and TypeScript; CommonJS `require` is not supported for modern Node.js usage.","wrong":"const { fromDirectory } = require('allure-store');","symbol":"fromDirectory","correct":"import { fromDirectory } from 'allure-store';"},{"note":"Used for reading compiled Allure2 reports from various sources (local path, URL, HTML file). Explicit named import is correct.","wrong":"const fromReport = require('allure-store').fromReport;","symbol":"fromReport","correct":"import { fromReport } from 'allure-store';"},{"note":"This is a core interface/type for extending or type-checking custom stores. While you instantiate stores via functions like `fromDirectory`, the `AllureStore` interface defines the contract.","symbol":"AllureStore","correct":"import type { AllureStore } from 'allure-store';"}],"quickstart":{"code":"import { fromDirectory } from 'allure-store';\n\n(async () => {\n  // Ensure 'allure-results' directory exists and contains Allure data\n  const store = await fromDirectory('allure-results');\n\n  // Retrieve all test results found in the store\n  const allResults = await store.getAllResults();\n  console.log('Total test results:', allResults.length);\n  if (allResults.length > 0) {\n    console.log('First result name:', allResults[0].name);\n  }\n\n  // Get the latest results, useful for history tracking\n  const latestResults = await store.getLatestResults();\n  console.log('Latest results per historyId:', Object.keys(latestResults).length);\n\n  // Fetch defined categories\n  const categories = await store.getCategories();\n  console.log('Categories loaded:', categories);\n\n  // Example of writing environment info (requires overwrite: true in fromDirectory if directory exists)\n  const writeStore = await fromDirectory('allure-results-output', { overwrite: true });\n  await writeStore.writeEnvironmentInfo({\n    NODE_ENV: process.env.NODE_ENV ?? 'development',\n    BUILD_ID: process.env.BUILD_ID ?? 'local-build'\n  });\n  console.log('Environment info written to allure-results-output');\n})();","lang":"typescript","description":"This quickstart demonstrates how to initialize an AllureStore from an existing `allure-results` directory, retrieve various Allure test data (all results, latest results, categories), and also shows how to write new environment information to a specified output directory."},"warnings":[{"fix":"Monitor GitHub repository for updates and breaking changes. Consider this for non-critical parts of your infrastructure initially.","message":"The project is housed under `wix-incubator` on GitHub, indicating it might be an experimental or early-stage project. While actively maintained, users should be aware of its incubation status regarding long-term support guarantees or potential breaking changes in minor versions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure your Node.js environment is updated to version 16.14.0 or newer (e.g., using `nvm install 16` or `nvm use 16`).","message":"This package requires Node.js version 16.14.0 or higher. Running it with older Node.js versions will result in runtime errors due to unsupported syntax or APIs.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Initialize the store with `await fromDirectory('output-dir', { overwrite: true });` if you intend to replace or fully update existing data in the target directory.","message":"When using `fromDirectory` to write data, if the target directory already exists and you intend to overwrite its contents, you *must* pass `{ overwrite: true }` in the options. Failing to do so might prevent new data from being written or merged as expected.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Review any custom `Category` type implementations or data structures after upgrading to `v1.1.1` or later to ensure compatibility with the refined type definitions.","message":"Version 1.1.1 included a fix for erroneous properties in the `Category` type. If you were working with custom categories in versions <=1.1.0, your category definitions or consumption might need minor adjustments to align with the corrected type definition.","severity":"breaking","affected_versions":"<=1.1.0"}],"env_vars":null,"search_vec":"'1.2.0':78 '2024':91 'activ':82 'adapt':119 'aggreg':114 'allow':69 'allur':1,4,16,32,52,128 'allure-result':51 'allure-stor':3 'allure2':59 'allureread':104 'allurestor':25 'allurewrit':106 'api':23 'back':72 'backend':111 'bug':97 'cadenc':84 'capabl':115 'categori':39 'ci/cd':121 'compil':58 'contain':38 'current':75 'custom':109,124 'data':11,33,71 'detail':44 'differenti':100 'directori':54,62 'enabl':108 'enhanc':95 'entiti':34 'environ':40 'executor':43 'extens':10 'featur':94 'file':64 'fix':98 'flexibl':8 'focus':92 'high':118 'html':63 'http/https':66 'includ':101 'inform':41 'initi':87 'interact':14 'interfac':107 'javascript':127 'key':99 'late':90 'librari':46 'like':35 'local':61 'make':116 'offer':20 'pipelin':122 'pluggabl':103 'provid':6 'read':27,48 'relat':81 'releas':83,88 'report':60,125 'result':18,37,53,113 'sinc':85 'storag':110 'store':2,5,12 'support':47 'test':17,36 'tool':126 'tradit':50 'transform':30 'typescript':129 'unifi':22 'url':67 'various':31 'version':77 'well':56 'write':28,70","created_at":"2026-04-20T01:51:08.730527+00:00","updated_at":"2026-04-20T01:51:08.730527+00:00","problems":[{"fix":"Update your import statements to use ES module syntax: `import { fromDirectory } from 'allure-store';` and ensure your project is configured for ESM (e.g., `\"type\": \"module\"` in `package.json`).","cause":"Attempting to use CommonJS `require()` syntax in a module that is ESM-only or within an ESM context.","error":"TypeError: require is not a function"},{"fix":"Verify the path to your Allure results directory is correct and that the directory actually exists. Create it if you intend to write to it and it's missing, or ensure a test runner has generated results there.","cause":"The specified `allure-results` directory does not exist at the given path when calling `fromDirectory`.","error":"ENOENT: no such file or directory, scandir 'allure-results'"},{"fix":"Ensure you are using a store initialized with write capabilities, such as `fromDirectory`, and if overwriting is intended for an existing directory, pass `{ overwrite: true }` in options for `fromDirectory`.","cause":"The `AllureStore` instance was created in a read-only mode or you are attempting to call a write method on an interface that only supports reading (e.g., a custom `AllureReader` implementation that doesn't also implement `AllureWriter`).","error":"TypeError: store.writeEnvironmentInfo is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/wix-incubator/allure-store","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/allure-store","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","observability"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}