s-tablename

0.4.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i s-tablename

Weekly Downloads

0

Version

0.4.0

License

MIT

Last publish

Collaborators

  • tjholowaychuk