# How can I get version constant in p5.js?

**URL:** <https://discourse.processing.org/t/how-can-i-get-version-constant-in-p5-js/28217>\
**Category:** p5.js\
**Created:** [March 3, 2021, 11:33am UTC](https://discourse.processing.org/t/how-can-i-get-version-constant-in-p5-js/28217 "2021-03-03T11:33:15Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [March 3, 2021, 4:52pm UTC](https://discourse.processing.org/t/how-can-i-get-version-constant-in-p5-js/28217/4 "2021-03-03T16:52:29Z")

</div>

> [@micuat](#):
>
> … I want to get the version as a constant variable.

> [@Detect p5 1.1.9 vs 1.0.0?](https://discourse.processing.org/t/detect-p5-1-1-9-vs-1-0-0/22920/2):
>
> I’m also puzzled why devs from both Processing Java & p5js flavors so adamantly refuse to add some way for a sketch to inspect which version it is running on. crazy_face Indeed the p5 constructor doesn’t contain any info about its version. The only place I’ve found it was inside the “p5.js” file itself on its 1st line as a comment block. Take a look at these 2 examples below. 1st is from the current “v1.1.9” and 2nd is from a very old “v.0.2.3”: /\*! p5.js v1.1.9 July 22, 2020 \*/: [cdn.…](http://cdn.JsDelivr.net/npm/p5@1.1.9)

---

_[View the full topic](https://discourse.processing.org/t/how-can-i-get-version-constant-in-p5-js/28217)._
