npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

parse-dictd

v1.0.1

Published

parse dictd dictionary files (.dict.dz and .index)

Downloads

11

Readme

parse-dictd

parse dictd files (.dict.dz and .index)

example

var parse = require('parse-dictd');
var fs = require('fs');
var gunzip = require('zlib').createGunzip;

var dstream = fs.createReadStream(process.argv[2]).pipe(gunzip());
var istream = fs.createReadStream(process.argv[3]);

parse(dstream, istream).on('data', console.log);
process.stdout.on('error', process.exit);

To run this example, you'll need a .dict.dz and .index file. You can grab one of the dict- packages on a debian system, for example:

sudo apt-get install dict-stardic

to grab an english to chinese dictd dictionary.

$ node example/dict.js /usr/share/dictd/stardic.{dict.dz,index} | head -n30
{ from: '00databasedictfmt11011',
  to: [ '00-database-dictfmt-1.10.11' ] }
{ from: '00databaseshort', to: [ '00-database-short' ] }
{ from: 'qi', to: [ 'n.气(中医)' ] }
{ from: 'be able to', to: [ '能够' ] }
{ from: 'be busy with', to: [ '忙于' ] }
{ from: 'be good at', to: [ '在.方面(学得)好', '善于' ] }
{ from: 'bedifferent from', to: [ '和...不同' ] }
{ from: 'get close to', to: [ '接近' ] }
{ from: 'go on the stage', to: [ '当演员' ] }
{ from: 'notat all', to: [ '根本(不)' ] }
{ from: '100metre race', to: [ '100米(赛跑)' ] }
{ from: 'a', to: [ 'art. 一;' ] }
{ from: 'a basin of', to: [ '一盆...' ] }
{ from: 'a beam of light', to: [ '一束光' ] }
{ from: 'a bill of fare', to: [ '菜单;节目单' ] }
{ from: 'a bit', to: [ '有一点儿' ] }
{ from: 'a bit of', to: [ '一点' ] }
{ from: 'a blanket of', to: [ '一片或一页的' ] }
{ from: 'a blast of', to: [ '一阵风' ] }
{ from: 'a block of', to: [ '一大块...' ] }
{ from: 'a bottle of', to: [ '一瓶' ] }
{ from: 'a bowl of', to: [ '一碗…' ] }
{ from: 'a burning desire', to: [ '强烈的愿望' ] }
{ from: 'a burst of laughter', to: [ '爆发一阵笑声' ] }
{ from: 'a case in point', to: [ '一个恰当的例子' ] }
{ from: 'a chemists shop', to: [ '药房' ] }
{ from: 'a close game', to: [ '势均力敌的比赛' ] }
{ from: 'a cluster of', to: [ '一群;一组' ] }
{ from: 'a column of water', to: [ '水柱' ] }

methods

var parse = require('parse-dictd')

var r = parse(dstream, istream)

Return a readable object stream r that parses two input streams:

  • dstream - an uncompressed stream of .dict.dz data
  • istream - a stream of .index data

r generates output as objects with from and to properties.

install

With npm do:

npm install parse-dictd

license

MIT