cookieconsent ships as vanilla-cookieconsent, and its build backgrounds one Rollup run and then waits
:cookie: Simple cross-browser cookie-consent plugin written in vanilla js
At a glance
- What is it?
- A vanilla JavaScript cookie consent banner: three different names for one thing, a build script that backgrounds one Rollup run, runs the other, and waits, only dist and types published, no runtime dependencies at all, an npm package maintained by someone other than the repository author, and a latest release, v3.2.1, dated 2026-10-30.
- Who is it for?
- cookieconsent fits a site that wants a consent banner without adopting a framework or a tag manager, and its zero runtime dependencies are the strongest reason to consider it. Three things to check before you take it.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 12 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- orestbida/cookieconsent5,769 ★ · +87
| Repository | 2026-09-23 | 2026-11-15 |
|---|---|---|
| orestbida/cookieconsent | 5.7k | 5.8k |
87 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
One project, three names
The same thing goes by three names depending on where you meet it.
The repository is `cookieconsent`, the README heading calls it CookieConsent v3, and the npm package is `vanilla-cookieconsent`. The manifest's own description string is the repository description with a cookie character in front of it, both reading as a simple cross-browser cookie consent plugin written in vanilla JavaScript.
Only the third name is installable. Anyone reading a tutorial, copying a snippet or writing a dependency by hand has to know that the name on the registry is not the name of the repository and not the product name either.
The version carries the third name in the file: the manifest reads `3.2.1`, which matches the v3.2.1 tag dated 2026-10-30. The heading's version number and the package version agree, so the v3 in the title is the major version of the package rather than a product generation.
Two more identifiers disagree in the same file. The homepage field points at the documentation site, while the address recorded for the repository as a whole is a playground on a subdomain of that site. So the package metadata sends you to the docs and the repository metadata sends you to a live demo.
The build script backgrounds both compiler runs and then waits
One line does the whole build:
"build": "pnpm rollup:full & pnpm rollup:core; wait",There is a single ampersand between the two Rollup invocations, which backgrounds the first rather than sequencing the second after it, and a `wait` with no arguments after the semicolon. So the full and core builds run at the same time, and the script waits for both before returning.
What that wait reports is the problem. A `wait` with no operands waits for the background jobs and returns zero; it does not propagate either child's exit status. So the build's exit code comes from the wait rather than from Rollup, and a bundle that failed to compile can still leave the command reporting success. Anyone relying on a non-zero exit to stop a pipeline is relying on something this script does not provide.
The two builds come from two separate configs, `rollup-full.config.mjs` and `rollup-core.config.mjs`, and the manifest names two outputs: `main` is `dist/cookieconsent.umd.js` and `module` is `dist/cookieconsent.esm.js`. Nothing in the manifest says which config produces which file, so the split between the core and full builds has to be read out of the config files.
The development script uses the full config with a watch flag, which is consistent with the full build being the one a developer iterates against.
Two directories are published and there are no runtime dependencies
The manifest's `files` array has two entries, `dist` and `types`. Nothing else in the repository reaches npm.
That excludes the source directory, the three demos, the playground, the documentation site, the tests and the build scripts. A consumer installing the package gets the compiled bundles and the type declarations, and the type entry point is `types/index.d.ts`, declared through a top-level `types` field.
The dependency list is the more interesting part. There is no `dependencies` key at all. Everything in the manifest is under `devDependencies`, and there are around twenty entries there, from Babel and Rollup plugins through Jest, PostCSS and cssnano to a jsdom test environment.
So the shipped artefact has no runtime dependencies. Nothing is installed alongside it, and a page loading the UMD bundle pulls in no library the plugin did not write. For a script that runs on every page load, that is the property that matters most, and it is the reason the description calls the plugin lightweight.
The CSS pipeline is part of the same story rather than a separate concern. PostCSS and cssnano are present, along with a plugin for combining duplicated selectors, which is what lets the stylesheet ship minified with repeated selectors merged rather than simply compressed.
The npm package is maintained by someone other than the author
The README contains a line about the registry rather than about the code.
After the contributor credits and the contributors image, there is a specific thank you to an individual named Till Sanders, given for creating and maintaining the npm package. The repository's own author field is a different person, Orest Bida.
So the code and the publication are separate pieces of work with separate maintainers. That is a distinction worth holding onto for two reasons. It means the version on npm and the state of the repository are produced by different people on different schedules, and it means a supply chain question about who can publish has an answer that is not the repository's author.
The publishing side is thin, though. The package name is unscoped and descriptive rather than namespaced.
The rest of the project infrastructure is small in the same way. Continuous integration is a GitHub Actions test workflow, linked from a status badge in the README, and the repository has a `.github/` directory.
The last release is twenty months older than the last commit
Two dates in this repository are far apart, and the gap between them says more than either one alone.
The most recent push is dated 2026-10-30. The most recent release, v3.2.1, is dated 2026-10-30, after v3.2.0 the same day and v3.1.0 on 2025-02-04.
So after v3.1.0 in February 2025 there was no release for about twenty months, until two arrived on the same day in October 2026.
The pattern looks like a project that does periodic releases rather than continuous ones, with a long gap at the end of the current cycle. Nothing in the repository states a release cadence, and there is no changelog file in the top-level listing to tell you what changed between v3.1.0 and v3.2.0.
For an adopter the practical question is which version you get. The manifest on the default branch now reads 3.2.1, matching the latest tag.
Lint runs inside the bundler and the tests run in one process
Two build details say something about how the project is put together.
The first is that ESLint is wired into Rollup rather than standing beside it. `@rollup/plugin-eslint` appears in the development dependencies alongside the terser plugin, and the two Rollup configs are what invoke them. So lint failures surface during the bundle step, in the same command that produces the artefact, rather than in a separate check that a release script has to remember to run.
The second is the test invocation: `jest --runInBand --coverage --silent ./tests`. The `--runInBand` flag runs every test file in a single process instead of spawning workers, and `--silent` suppresses console output. A jsdom test environment is configured for the run, which is how DOM behaviour gets tested without a browser.
Serial execution is the notable choice. Most projects let Jest fan out across cores, and forcing one process costs wall-clock time on a large suite. For DOM-bound tests it avoids the class of problem where a shared resource is mutated by two workers at once.
The documentation is built separately again, with its own three scripts driving a documentation generator in dev, build and serve modes over a `docs` directory. So there are three distinct toolchains in this manifest: Babel and Jest for tests, Rollup with the lint and minifier plugins for the bundle, and the docs generator for the site.
Four demos, one of which runs the banner inside an iframe
The demo directory holds four entries, and their names describe the integration surface rather than the features.
One is a basic demo. One is for Google Tag Manager, which is the integration people most often need because the tag manager is where consent state has to be reported. One is for an iframe manager.
There is an assets directory alongside the three demos, which is where shared demo resources live.
Two other places to see the plugin running sit outside the repository: a playground on a subdomain of the documentation site, and a collection of examples on Stackblitz. Three separate environments, which is a reasonable amount of surface for a library whose entire user interface is one dialog.
Editorial conclusion
cookieconsent fits a site that wants a consent banner without adopting a framework or a tag manager, and its zero runtime dependencies are the strongest reason to consider it. Three things to check before you take it. The npm package is `vanilla-cookieconsent`, not `cookieconsent`, so a dependency you write by hand against the repository name will not resolve. The package publishes two Rollup outputs, a UMD file and an ES module, from two separate configs, and the manifest does not say which config produces which, so check the file size and the format you need before wiring it up. And the build script backgrounds the first Rollup invocation, runs the second, and then waits without arguments, so the exit status of the build comes from the wait rather than from either compiler run, which means a failing bundle can still report success.
Frequently asked questions
What is cookieconsent?
A lightweight, GDPR-compliant cookie consent plugin written in plain JavaScript, with no framework and no runtime dependencies. The repository is orestbida/cookieconsent, the README calls it CookieConsent v3, and it is published to npm as vanilla-cookieconsent.
Is cookieconsent a CMP, a consent management platform?
It does not describe itself that way. Neither the README nor the visible manifest uses the term. What it claims is that it is lightweight and GDPR compliant, and gdpr appears in its keyword list.
How do I install cookieconsent?
From npm under the name vanilla-cookieconsent, not cookieconsent. The manifest declares main as dist/cookieconsent.umd.js, module as dist/cookieconsent.esm.js and types as types/index.d.ts, and only the dist and types directories are published.
Does cookieconsent need a framework or a build step?
No framework, and nothing to build at the consumer end. The manifest has no dependencies key at all, only devDependencies, so the shipped bundle pulls in no library the plugin did not write. Babel, Rollup, Jest and PostCSS are all development-only tools.
Is a cookie consent banner required by law in the USA?
The repository does not answer jurisdiction questions and makes no claim about United States requirements. Its own wording is limited to the claim that the plugin is lightweight and GDPR compliant, and the compliance claim is the author's rather than a legal analysis.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/orestbida-cookieconsent)Star history chart for your README
[](https://hysenlabs.com/projects/orestbida-cookieconsent)Was this useful?