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 🙏

© 2026 – Pkg Stats / Ryan Hefner

dat-shared-files

v2.0.0

Published

Seed and track locally shared files as dat links

Readme

Dat shared files

This module is a helper around dat to make it easier to share files instead of directories.

When sharing, dat creates a .dat folder with metadata about the shared files. While it is possible to create ignore lists, it is not easy to use the same folders to share different files as different dat links. See this issue for a bit more background.

This modules solves the problem by symlinking files into folders. In this way the files are only stored once, but this also means that if you intend to share the files for a longer period of time, it is probably best to move them somewhere where they will not be deleted so easily.

Secondly once you have shared a dat link, there is no registry that easily keeps track of your shared files. This is the second purpose of this module.

The database and symlinks are stored in the ~/.dat-shared-files/ folder.

The main purpose of this module is to make it easier to integrate dat with ssb.

Example usage

var datSharedFiles = require('dat-shared-files')

datSharedFiles.shareFile(filePath, (err, datLink) => {
  if (err) console.error(err)
  else console.log('new dat:', datLink)
})

API

shareFile(file, cb)

Takes a filepath and creates a dat, adds it to local db of dats being shared, and calls back with err or the dat link as second argument.

shareFiles(files, cb)

Takes a list of filepaths and creates a dat, adds it to local db of dats being shared, and calls back with err or the dat link as second argument.

shareAll(cb)

Reads the list of all DATs made by this module, and starts sharing them all. Calls back with err or an array of all dat links currently registered.

listLinks(cb)

Calls back with err or an array of all dat links currently registered.

datLink(datLink, cb)

Calls back with err or the path to where the file for the named dat link are currently stored.

removeLink(datLink, cb)

Removes the DAT from the database, meaning this DAT will not be included in functionality like e.g. datShareFiles. Will not err if link is not found.

CLI

Can also be installed globally as dat-shared-files, where the above functionality is available from the command line (see -h).

See also

ssb-dat-autoshare for more integration between dat and ssb.