def npm(name = nil, options = {})
      if name.is_a?(Hash)
        options, name = name, nil
      end

      package_name = options.fetch(:package)
      version = options.fetch(:version)
      remote_source = RemoteSources::Npm.new(package_name, version)

      name ||= remote_source.package
      packages << Package.new(name, remote_source, options)
    end
def npm(name = nil, options = {})
      if name.is_a?(Hash)
        options, name = name, nil
      end

      package_name = options.fetch(:package)
      version = options.fetch(:version)
      remote_source = RemoteSources::Npm.new(package_name, version)

      name ||= remote_source.package
      packages << Package.new(name, remote_source, options)
    end
Adds {Package} with {RemoteSources::Npm} to {#packages}
 @since 0.3.0