Skip to content

tzwel/co

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation


'co' logo

co

A tiny (353B) utility to create paths from strings

Import

const co = require('./co')

Use

co(['../', 'some/', '/path/', 'image.png'])
// Returns: '../some/path/image.png'

co(['C:/', '///te', 'mp\\\\/', '\\/\\/foo/bar'])
// Returns: 'C:/temp/foo/bar'

Automatic slash insertion

co(['..', 'some', 'path', 'image.png'], true)
// Returns: '../some/path/image.png'