Socket
Book a DemoInstallSign in
Socket

dbjs-ext

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dbjs-ext

Extension types for dbjs database engine

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
5
-44.44%
Maintainers
1
Weekly downloads
 
Created
Source

dbjs-ext

Common type extensions for dbjs engine

Installation

$ npm install dbjs-ext

To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: Browserify, Webmake or Webpack

Provided types

List of extensions is not closed and is still being completed.

  • DateTime
    • Date - Date, where time is not applicable. Date is saved against UTC time-zone, and it's guaranteed to produce same dates in any time-zone application is run
  • Number
    • Currency - Abstract currency type, should be used only to create specific currency types
      • ArgentinePeso - Argentine Peso
      • CfaFranc - CFA Franc
      • GuatemalanQuetzal - Guatemalan Quetzal
      • UsDollar - US Dollar
      • TzsDollar - Tanzania Dollar
    • HorsePower - Horsepower unit
    • Integer - Integer
      • UInteger - Unsigned integer (technically just positive integer)
        • Time - Time (milliseconds between 0:00:00.000 and 23:59:59.000)
    • Percentage - Percentage
    • SquareMeters - Square meters
  • Object
    • DateTimeRange - Time Range
    • File - Computer file
      • ImageFile - Image file
        • JpegFile - JPG file
        • PngFile - PNG file
      • MsWordFile - MS Word file
        • MsWordDocFile - MS Word .doc file
        • MsWordDocxFile - MS Word .docx file
      • PdfFile - PDF file
    • OneDayTimeRange - Time Range within one day
  • String
    • StringLine - String line (string with no new-line characters)
      • Country - Country
      • Email - Email
      • Filename - Computer filename
      • Gender - Gender (male/female)
      • MimeTypeGroup - Mime type group
        • MimeType - Mime type
      • Password - Password
      • Sha256Hash - Sha256Hash
      • Url - Url

Usage

var Database = require('dbjs');
var db = new Database();
require('dbjs-ext/string/string-line/email')(db)
require('dbjs-ext/string/string-line/password')(db);

Db.Object.create('User', {
  email: { type: db.Email, required: true },
  password: { db.Password, required: true }
});

Tests

$ npm test

Keywords

db

FAQs

Package last updated on 15 May 2017

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