<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          npmsearchblazing fast npm search utility

          聯(lián)合創(chuàng)作 · 2023-09-22 20:15

          npmsearch.com

          N|Solid

          This is the code that powers npmsearch.com, which provides a clean interface to searching pseudo-rated node packages from npm.

          api

          To query the npmsearch index, you can use the HTTP api which is effectively a proxy to elasticsearch's URI Search.

          All requests go through http://npmsearch.com/query. Here's an example:

          curl "http://npmsearch.com/query?q=dom&fields=name"
          {"results":[{"name":["select-dom"]},{"name":["dom-manipulations"]},{"name":["zero-dom"]},{"name":["dom-stub"]},{"name":["dom-walk"]},{"name":["dom-value"]},{"name":["karma-chai-dom"]},{"name":["dom-select"]},{"name":["dom-listeners"]},{"name":["has-dom"]}],"total":7265,"from":0}
          

          Available fields

          • author
          • created
          • dependencies
          • description
          • devDependencies
          • homepage
          • keywords
          • maintainers
          • modified
          • name
          • readme
          • repository
          • scripts
          • times
          • version
          • rating - computed rating as per bin/rating.js

          Running your own npmsearch

          Setup Elasticsearch

          See the elasticsearch docs for setting up a node

          # create an index
          
          curl -XPUT http://localhost:9200/my-index-name
          
          # setup the package field mappings
          
          cat mappings.json | curl -v -XPOST http://localhost:9200/my-index-name/package/_mapping -H "Content-type: application/json" -d @-
          
          # setup an alias to 'registry'
          
          curl -XPOST 'http://localhost:9201/_aliases' -d '
          {
            "actions" : [
              { "add" : { "index" : "my-index-name", "alias" : "registry" } }
            ]
          }'
          

          pipe the npm registry into elasticsearch

          npm2es --couch="https://skimdb.npmjs.com/registry" --es="http://localhost:9200/registry"
          
          

          run the server

          node bin/server.js --es="http://localhost:9200/registry"
          

          compute ratings

          node bin/rating.js --es="http://localhost:9200/registry"
          

          Authors and Contributors

          Elijah Insua GitHub/tmpvar Twitter/@tmpvar

          Authored by Elijah Insua. Contributions are welcomed from anyone wanting to improve this project!

          License & Copyright

          npmsearch is Copyright (c) 2016 NodeSource and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.txt file for more details.

          瀏覽 15
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  欧美三级黄色全部 | 天天操天天添 | 黄片大全在线看 | 国产香蕉网 | 污视频在线观看免费 |