简体   繁体   中英

Ways to identify if my clients are using the CDN or NPM versions of my JS library?

I am currently in the midst of thinking of launching an open sourced version of my library on NPM. However, I'm wondering if there is a way for me to know whether the clients are using my CDN/NPM especially.

Is there anyway that this can actually be done?

I've thought about this and have come up with one idea so far:

  1. Adding a commit tag to the minified file, which allows me to see the commit hash of a version either from NPM, or from our own CDN.

Would be good to hear if anyone else has ideas!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM