mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
9 lines
349 B
Python
9 lines
349 B
Python
# MIT licensed
|
|
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
|
|
|
|
NPM_URL = 'https://registry.npmjs.org/%s'
|
|
|
|
async def get_version(name, conf, *, cache, **kwargs):
|
|
key = conf.get('npm', name)
|
|
data = await cache.get_json(NPM_URL % key, headers={"Accept": "application/vnd.npm.install-v1+json"})
|
|
return data['dist-tags']['latest']
|