Giter VIP home page Giter VIP logo

alfred-npmjs's Introduction

alfred-npmjs

Github 中文 README

Alfred workflow to search for npm packages with npmjs.com

npm is the package manager for JavaScript and the world’s largest software registry. alfred-npmjs can search and reach the package repo page more quickly than npmjs.com

Using CMD + Enter to copy package "name": "^version" to clipboard.

Download and installation

Download the latest version from Github releases page or packal download

Features

  • For accurate search (default show 3 packages, you can modify the max number)
  • Display the packages' avator images
  • Cache package lists, if the sum of avator images is greater than 10, the images downloaded could be deleted. (default cache 10 images files)

Usage

In Alfred, type npm, Space , package your want to search. (eg: npm lodash)

Select a package and press Enter to go to the package npm.js repo.

Contributing

Run project

The workflow is written in Go and uses AwGo library for all Alfred related things.

It uses modd to ease its development.

  1. Clone repo
  2. Run build.sh (makes symbolic link of workflow directory)
  3. Run modd (starts a process that automatically builds the workflow with build.sh on any changes you make to .go files, this builds and places a binary inside workflow directory.)
  4. Make changes to code or modify Alfred objects to do what you want! Open debugger in Alfred or run the workflow with workflow:log passed in as argument to see the logs Alfred produces.

Changelog

v1.1.4

  • Support automatic request retry.
  • Fix keyword with / not searching.

v1.1.3

  • Fix copy text format

v1.1.2

  • feat: add NPM_REGISTRY environment variable to change registry host

v1.1.0

  • refactor: using golang
  • feat:speed up icon downloading

v1.0.4

  • fix: search URL not work

v1.0.3

  • fix: description optional bug

v1.0.2

  • fix: searching error when input a package name including slash.

v1.0.1

  • provide a faster search HK Proxy for Chinese User

v1.0.0

  • init project

Contributing

GitHub issues

alfred-npmjs's People

Contributors

dependabot[bot] avatar ycjcl868 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alfred-npmjs's Issues

'NoneType' object has no attribute 'read'

Starting debug for 'NpmSearch'

[2018-03-26 21:02:16][ERROR: input.scriptfilter] Code 1: 21:02:16 workflow.py:2249 DEBUG    workflow version: 1.0.2
21:02:16 workflow.py:2462 DEBUG    update_data: None
21:02:16 workflow.py:2267 ERROR    'NoneType' object has no attribute 'read'
Traceback (most recent call last):
  File "/Users/racan/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.32269DE4-9B2C-4C9A-9A6D-92B6E98E2ED3/workflow/workflow.py", line 2260, in run
    func(self)
  File "npm_workflow.py", line 63, in main
    data = wf.cached_data(query, functools.partial(queryPackage, query), max_age=MAX_AGE)
  File "/Users/racan/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.32269DE4-9B2C-4C9A-9A6D-92B6E98E2ED3/workflow/workflow.py", line 1890, in cached_data
    data = data_func()
  File "npm_workflow.py", line 50, in queryPackage
    return web.get(url).json()
  File "/Users/racan/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.32269DE4-9B2C-4C9A-9A6D-92B6E98E2ED3/workflow/web.py", line 271, in json
    return json.loads(self.content, self.encoding or 'utf-8')
  File "/Users/racan/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.32269DE4-9B2C-4C9A-9A6D-92B6E98E2ED3/workflow/web.py", line 302, in content
    self._content = self.raw.read()
AttributeError: 'NoneType' object has no attribute 'read'
21:02:16 workflow.py:2290 DEBUG    workflow finished in 0.379 seconds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.