nvchecker/nvchecker_source/npm.py

10 lines
290 B
Python
Raw Normal View History

2020-08-17 14:04:44 +00:00
# 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)
return data['dist-tags']['latest']