slash-helper

Remove trailing slashes and prepend slash to a URL

Usage no npm install needed!

<script type="module">
  import slashHelper from 'https://cdn.skypack.dev/slash-helper';
</script>

README

Usage

var slash = require('slash-helper');
slash.normalizePath('http://my.example.com/123/');

returns http://my.example.com/123

slash.normalizePath('/example/123/');

returns /example/123