
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@owliehq/neatsio
Advanced tools
When using Neatsio REST lib, you can create REST APIs in seconds. Built on top of ExpressJS, Neatsio REST removes your boilerplate work time. Focus on models and business logic, the lib generate automatically endpoints based on mongoose/sequelize schemas. Save your time and enjoy with your new REST routes.
This lib is opinionated, some features or development orientation are due to personal choices, but PR are welcome.
$ npm install --save @owliehq/neatsio
$ npm install --save express body-parser sequelize
[OPTIONAL FOR TESTING]
$ npm install --save sqlite3
const express = require('express')
const bodyParser = require('body-parser')
const neatsioRest = require('@owliehq/neatsio')
const Sequelize = require('sequelize')
const sequelize = new Sequelize({
dialect: 'sqlite',
storage: __dirname + '/database.sqlite',
logging: false
})
// Init your sequelize models
class User extends Sequelize.Model {}
User.init(
{
firstname: { type: Sequelize.DataTypes.STRING, allowNull: false },
lastname: { type: Sequelize.DataTypes.STRING, allowNull: false },
email: { type: Sequelize.DataTypes.STRING, allowNull: false }
},
{
sequelize,
modelName: 'user'
}
)
const app = express()
// Register your model
neatsioRest.registerModel(User)
// Bodyparsing is needed to handle payloads on POST / PUT routes
app.use(bodyParser.json())
// Neatsio brings to you an express router
app.use('/api', neatsioRest.routes)
sequelize.authenticate().then(() => {
User.sync().then(() => {
app.listen(3000, () => {
console.log('Neatsio REST API started on port 3000!')
})
})
})
$ node app.js
# Get all users (empty)
GET http://localhost:3000/api/users
# Create an user
POST http://localhost:3000/api/users
# Get user by ID
GET http://localhost:3000/api/users/1
# Get user's lastname by ID
GET http://localhost:3000/api/users/1?$select='lastname'
# Get users lastname order by email DESC
GET http://localhost:3000/api/users?$select='lastname'&sort='-email'
# Get users populated with embed models with conditions
GET http://localhost:3000/api/users?$populate='posts.comments'&$conditions={"$or":[{"$email:"john@acme.com"},{"id":2}]}
# Update user
PUT http://localhost:3000/api/users/1
# Delete user
DELETE http://localhost:3000/api/users/1
# Create in bulk
POST http://localhost:3000/api/users/bulk
# Update in bulk with conditions
PUT http://localhost:3000/api/users/bulk?$conditions={"active":false}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.
Copyright (c) 2019
Licensed under MIT
FAQs
Generate REST API from your Sequelize / Mongoose models
We found that @owliehq/neatsio demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.