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

nexus-ilegacy

v0.2.0

Published

Tool to import your legacy libraries to Nexus OSS.

Downloads

12

Readme

nexus-ilegacy

Tool to recursively import maven, npm and nuget libraries to a repository like Nexus OSS, Artifactory, NPM and so on.



About

The purpose of this CLI is to import Maven, NPM or NuGet artifacts recursively to the Nexus OSS. It all began when we started to migrate from the Artifactory repo to the Nexus OSS repo at work. At that moment I didn't find a tool or functionality at Nexus to get the job done. So to avoid repetitive work I decided to write a simple cli that calls mvn, npm and nuget behind, taking a directory as starting point, to recursively search for artifacts to deploy to the Nexus OSS 3x.

During the execution is possible to check the total of import success and errors. In the end the CLI will generate a log file to better evaluate the results.

Prerequisites

The nexus-ilegacy CLI requires:

  • Node 6.9.0 or higher
  • NPM 3 or higher
  • Maven 3.3 or higher - to import Maven artifacts
  • NuGet 3 or higher - to import .NET artifacts

Installing

To install the CLI:

npm install i -g nexus-ilegacy

Docs install the Maven and NuGet

Important:

  1. Both Maven and NuGet need to be on OS PATH variable.
  2. For Maven be sure to configure a server in the settings.xml file at the .m2 folder. This is needed as it contains the credentials to deploy the artifact to the Nexus maven repository.

Example of a settings.xml file:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>{server_name}</id>
      <username>{nexus_user_login}</username>
      <password>{passwd}</password>
    </server>
  </servers>
</settings>

This server id the "--repositoryId" argument, so the mvn command will get this username and password to proceed with the deploy.

HINT Never expose your password in plain text. For maven password encryption , follow this guide.

Usage

nilegacy --help

The command syntax is:

nilegacy [repo] [options] directory_to_search_recursively

Repo

In the repo argument you should use one of following options:

  • maven
  • npm
  • nuget

Options

General options (valid for maven, nuget and npm):

--repoUrl - repository URL
--version - show the current version
--help - display help
--output -change the output log file. Default is ./nilegacy-YYYYMMDDHHmmss.log

Options available only for maven:

--repositoryId - repository ID as configured in Maven settings.xml
--generatePom - if specified will force the pom generation, otherwise, will use the same name of the jar file for the pom
--groupId - group ID must be informed if generatePom is true

Directory

The directory path to search for files. The execution will look for files with the following extensions / patterns:

  • maven: *.jar
  • nuget: *.nupkg
  • npm: package.json and *.tgz The CLI will recursively look for files except for those located in node_modules, considering NPM packages.

Important: Remember to check if the user have permission to access the directory.

Importing Maven Artifacts

The CLI will look for files with the .jar extension and *.sources.jar and *.javadoc.jar are also considered. Behind the scenes it will execute the maven deploy plugin. CLI example to upload maven artifacts to Nexus OSS:

nilegacy maven --repoUrl http://localhost:8081/repository/maven-hosted --repositoryId repo-maven /home/user/artifactory_
maven_backup

Important: Note the --repositoryId. This id must exists in the servers config at the settings.xml.

Importing NPM Artifacts

This CLI will search recursively looking for package.json and *.tgz files, except those inside node_modules.

First of all you have to setup the user that will publish the package.

npm adduser --registry <repo_url>

Example:

npm adduser --registry http://localhost:8081/repository/npm-internal

Then run the nilegacy import command :

nilegacy npm --repoUrl http://localhost:8081/repository/npm-internal ./directory-with-npm-libs

Limitations: NPM Issue #10117

Importing NuGet Artifacts

TODO: To be done

History

For the list of all changes see the history log.

License

Licensed under MIT.

Copyright (c) 2017 Mauricio Gemelli Vigolo @mauriciovigolo