Skip to content

dominictarr/npm-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm-search

An index of npm using levelup.

installation

#download all the json in npm (~350 mb in feb 2013)
./dl-npm-json.sh

#initialize db
node index.js

node search.js physic~ vox~
=>
{ 'voxel-control': [ [ 'PHYSICAL', 3 ], [ 'VOXEL', 5 ] ],
  'voxel-physical': [ [ 'PHYSICAL', 1 ], [ 'VOXEL', 1 ] ],
  'player-physics': [ [ 'PHYSICS', 6 ], [ 'VOXEL', 2 ], [ 'VOXELJS', 2 ] ],
  'voxel-player': [ [ 'PHYSICS', 2 ], [ 'VOXEL', 9 ], [ 'VOXELPLAYER', 2 ] ] }

Queries like that will take 200ms to 1000ms, most of this time is spent opening the database.

If you want it to go really fast, open a server, and then request to it.

node search.js --port 9876 &

# search terms seperated by /
curl localhost:9876/search/terms

If you end a search term with ~ then it will return everthing that matches that prefix.

node search.js stream~ err~

todo

This is currently just a bunch of scripts. Will polish this to make it a propper tool.

license

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published