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

@fxjs/knex

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fxjs/knex

fibjs wrapper & helper of knexjs

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-83.33%
Maintainers
2
Weekly downloads
 
Created
Source

Fibjs Wrapper For Knexjs

NPM version Build Status Build status

Introduction

One fibjs wrapper for knex, which is designed for NodeJS and Browser.

Pre-requisite

There's no built-in knex in this package's dependencies, for purpose that you can use any valid version knex as you like

  • knex@>= 0.14 < 0.17

if use typescript, install types to enable typo lint:

  • @types/node

APIs

cjs: Wrapped Knex

You can get Wrapped Knex safely like this:

const FKenx = require('@fxjs/knex')

assert.property(FKenx, 'SandBox')

Distinguished with the original knex package, fibjs version one has more properties:

  • SandBox: one SandBox class extended from vm.SandBox, which has required modules on which knex run in fibjs;

Use FKenx.SandBox to customized your own SandBox

There's only necessary modules for knex in built-in sandbox, you can customized your own sandbox by create one SandBox instance. Just use FKenx.SandBox as fibjs's built-in vm.SandBox like this:

const FKenx = require('@fxjs/knex')

const vbox = new FKenx.SandBox(
    // modules
    {
        a: AMOD,
        b: BMOD,
        // useless, it's reserved module
        uuid: require('uuid')
    },
    // optional, fallback function
    (name) => require(name),
    // optional, global object
    {
        // ...
    }
)

All reserved modules would NOT been overwritten by the ones user passing, they are:

  • fs
  • path
  • os
  • url
  • tty
  • util
  • events
  • assert
  • crypto
  • uuid

LICENSE

MIT

Copyright (c) 2018-present, Richard

FAQs

Package last updated on 25 Sep 2019

Did you know?

Socket

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.

Install

Related posts

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