Socket
Book a DemoInstallSign in
Socket

s-tablename

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

s-tablename

Normalize a string for use as a Redshift table

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

Build Status

tablename

Normalize a string or event for use as a Redshift table.

Installation

$ npm install s-tablename

Examples

describe('tablename(str)', function(){
  it('should normalize the string', function(){
    tablename('foo bar baz').should.equal('foo_bar_baz');
    tablename('foo bar-baz').should.equal('foo_bar_baz');
    tablename('foo bar    baz').should.equal('foo_bar_baz');
    tablename('View a Page').should.equal('View_a_Page');
  })
})

describe('tablename(event)', function(){
  it('should return tablename with schema', function(){
    var s = tablename({
      projectId: '12345',
      action: 'Track',
      event: 'View a Page'
    });

    s.should.equal('12345.View_a_Page');
  })
})

License

MIT

Keywords

redshift

FAQs

Package last updated on 10 Apr 2014

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