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

cran-repo

v0.0.1

Published

Provides package discovery function against Cran like repository.

Downloads

2

Readme

Cran Repository

Makes dealing with CRAN repository for package searches, and retrieval easy.

import { CranLikeRepository } from './cran-repo';

const repo = new CranLikeRepository('https://not-valid-cran.org');

// Get Version
try {
  const geosphereVersions = repo.getLatestPackageVersion('geosphere');
  console.log(geosphereVersions[0].version); // 1.5-14
} catch (err) {
  console.log(err);
}

// Resolve Package
try {
  const geosphere = await r.resolvePackage('geosphere', '1.0.0');
  console.dir(geosphere, { depth: null });
} catch (err) {
  console.log(err);
}

Cran Like Repository Format

For more detailed reference refer to: https://environments.rstudio.com/repositories.

/src/contrib
  package_0.1.0.tar.gz
  PACKAGES.rds
  PACKAGES.gz
  PACKAGES
    /PATH
      package_0.1.tar.gz
    /Archive/
      /package/
        package_0.1.tar.gz
/bin
  /windows/contrib
    /1.3
    /1.4
      /PACKAGES
      /package_1.0.zip
  /macosx/
    /contrib
      /1.3
      /1.4
        /PACKAGES
        /package_1.0.tgz
    /mavericks
    /leopard
    /el-capitan

Note, some Cran-like repositories by artifactory and nexus, may store source archive at:

- /src/contrib/package_1.0.tar.gz
- /src/contrib/Archive/package_1.0.tar.gz
- /src/contrib/Archive/package/package_1.0.tar.gz
- /src/contrib/Archive/package/1.0/package_1.0.tar.gz

PACKAGES file

CRAN-like has metadata file called PACKAGES, which enumerates available packages in the repository.

Content of this file looks like:

Package: A3
Version: 1.0.0
Depends: R (>= 2.15.0), xtable, pbapply
Suggests: randomForest, e1071
License: GPL (>= 2)
MD5sum: 027ebdd8affce8f0effaecfcd5f5ade2
NeedsCompilation: no

Package: AATtools
Version: 0.0.2
Depends: R (>= 3.6.0)
Imports: magrittr, dplyr, doParallel, foreach
License: GPL-3
MD5sum: bc59207786e9bc49167fd7d8af246b1c
NeedsCompilation: no

PACKAGES.gz file

This is compressed version of PACKAGES file.

package_0.9.tar.gz file

This is source archive of package called package at version 0.9. This tarball will store DESCRIPTION file under: package/DESCRIPTION filepath.

This DESCRIPTION is required file for the R package, and must exist within source archive.