New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

arbase-crud

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arbase-crud - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

src/compile/template.js

12

package.json
{
"name": "arbase-crud",
"version": "0.0.1",
"version": "0.0.2",
"description": "Arbase-crud is a package to expose a CRUD-like interface from an arbase API config",
"main": "src/compile/index.js",
"main": "src/runtime/index.js",
"scripts": {

@@ -14,3 +14,3 @@ "test": "echo \"Error: no test specified\" && exit 1"

],
"runtime": "src/runtime/index.js",
"compile": "src/compile/index.js",
"author": "Maciej Krüger <mkg20001@gmail.com>",

@@ -25,3 +25,7 @@ "license": "MPL-2.0",

},
"homepage": "https://github.com/mkg20001/arbase-crud#readme"
"homepage": "https://github.com/mkg20001/arbase-crud#readme",
"dependencies": {
"@hapi/boom": "^8.0.1",
"@hapi/joi": "^16.1.5"
}
}
'use strict'
const fs = require('fs')
const path = require('path')
const template = String(fs.readFileSync(path.join(__dirname, 'template.js')))
function compileEndpoint ({prefix}, entry, helper) {
if (!entry) return ''
const name = (entry.ns ? entry.ns + '.' : '') + entry.name
return `crud({
server,
name: ${JSON.stringify(name)},
entry: ${helper.stringifyEntry(entry)},
prefix: ${JSON.stringify(prefix)},
middleware: {},
arweave
})`
}
function compile (data, helper) {
let insert = data.entries.map(entry =>
compileEndpoint({}, entry, helper)).join('\n')
return template.replace('/* INSERT */', insert)
}
module.exports = compile
'use strict'
module.exports = (def, a) => {
module.exports = {
crud: require('./crud')
}
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