Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dat-registry

Package Overview
Dependencies
Maintainers
5
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dat-registry - npm Package Compare versions

Comparing version 2.1.2 to 3.0.0

test.js

27

index.js

@@ -11,7 +11,24 @@ var Township = require('township-client')

if (!opts) opts = {}
var server = opts.server || 'https://datproject.org'
var api = server + '/api/v1'
var township = Township(xtend(opts, {
server: api // used over opts.server
}))
// datproject.org defaults, specify opts.server and opts.apiPath to override
var SERVER = 'https://datproject.org'
var API_PATH = '/api/v1'
var apiPath = (opts.server && opts.server.indexOf('datproject.org') > -1) ? API_PATH: opts.apiPath // only add default path to datproject.org server
var townshipOpts = Object.assign({}, opts)
// set default township server & routes for datproject.org
if (!townshipOpts.config.filename) townshipOpts.config.filename = '.datrc'
if (!townshipOpts.server) townshipOpts.server = SERVER
if (!opts.routes && apiPath) {
townshipOpts.routes = {
register: apiPath + '/register',
login: apiPath + '/login',
updatePassword: apiPath + '/updatepassword'
}
}
var api = townshipOpts.server + apiPath
var township = Township(townshipOpts)
return {

@@ -18,0 +35,0 @@ login: township.login.bind(township),

2

package.json
{
"name": "dat-registry",
"version": "2.1.2",
"version": "3.0.0",
"description": "dat registry api",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,5 +0,12 @@

# dat-registry-client
# dat-registry
API Registry Client for publishing dats.
API Registry Client for publishing dats. By default, the client is capable of registering, login, and publishing to datproject.org.
`dat-registry` allows users to interact with and publish dats to your registry via the `dat` command line. Supporting this module on your registry will allow a user to login and publish:
```
dat login custom-dat-registry.com
dat publish
```
## Installation

@@ -37,3 +44,5 @@

* `opts.server`: the server to query. Default is `https://datproject.org/api/v1`
* `opts.server`: the registry server. Default is `https://datproject.org`
* `opts.apiPath`: registery server API path, e.g. we use `/api/v1` for datproject.org. This will overwrite default township routes to use server + apiPath.
* `opts.config.filename`: defaults to `~.datrc` instead of township defaults.

@@ -45,3 +54,2 @@ Other options are passed to [township-client](https://github.com/township/township-client), these include:

config: {
filename: '.townshiprc', // configuration filename (stored in os homedir)
filepath: '~/.townshiprc' // specify a full config file path

@@ -73,3 +81,2 @@ },

### CRUD API

@@ -76,0 +83,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc