Skip to main content

Sopel plugin to handle NPM links/searches

Project description

sopel-npm

Sopel plugin to handle NPM links/searches

Installing

Releases are hosted on PyPI, so after installing Sopel, all you need is pip:

$ pip install sopel-npm

Using

sopel-npm offers two main features: link handling, and a search command.

Link handling

If someone posts a link to a package on npmjs.com, sopel-npm should emit an overview of that package's latest version:

<dgw> https://www.npmjs.com/package/plyr
<Sopel> [npm] plyr@3.7.8 | Published by sam_potts | MIT license | Unpacked
        size: 5.1 MiB in 124 files | A simple, accessible and customizable
        HTML5, YouTube and Vimeo media player

Links directly to a specific package version will show information for that release instead:

<dgw> https://www.npmjs.com/package/plyr/v/2.0.18
<Sopel> [npm] plyr@2.0.18 | Published by sampotts | MIT license | A simple,
        accessible and customizable HTML5, YouTube and Vimeo media player

.npm search command

Use .npm keywords here and sopel-npm will show details for the best match as returned by the NPM registry's search engine:

<dgw> .npm best vue plugin
<Sopel> [npm] eslint-plugin-pinia@0.4.1 | Published by lisilinhart | MIT
        license | Unpacked size: 47.4 KiB in 8 files | ESLint plugin for Pinia
        best practices | https://www.npmjs.com/package/eslint-plugin-pinia

This feature will always show details for the latest version of the matching package, if any.

Robustness

NPM metadata has evolved over time, and the registry doesn't normalize metadata for old releases. sopel-npm does its best to cope with missing data fields and return something useful, even if it's not complete.

Bug reports or pull requests are welcome if you run into a situation that this plugin can't handle gracefully!

Changelog

0.1.0

First release of sopel-npm with:

  • npmjs.com package link handling, with and without a version number
  • .npm command for text search of packages in the registry

Known issues:

  • Packages' publication times are not displayed, because the NPM registry's package-version endpoint inexplicably does not provide a release timestamp.
  • While all of the error-handling code paths should work, in theory, some haven't been verified in real-life testing yet.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sopel_npm-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

sopel_npm-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file sopel_npm-0.1.0.tar.gz.

File metadata

  • Download URL: sopel_npm-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.6

File hashes

Hashes for sopel_npm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 976a1f0ccddcbc1e4a594887f3463a6d80412d12761b71a94173b78e9d4b1a17
MD5 80e8b64cfad6492622c9dcc68a8e047d
BLAKE2b-256 ea1889cf23df1c7f283b45610e012c0a93cfc0eabdacc4c30c878bbc737415d8

See more details on using hashes here.

File details

Details for the file sopel_npm-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sopel_npm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.6

File hashes

Hashes for sopel_npm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94fc31e1675ca527128529516d122c505a77b6a2f820dbf3260715016374185e
MD5 2efe3c0bc23b8c39113d0182d691d63d
BLAKE2b-256 47727faf6c41a1a43d1a0abcea392c5bae901492f988357db84c931fecbfb2d9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page