Giter Club home page Giter Club logo

str-fns's Introduction

str-fns

npm version .github/workflows/ci.yml

A collection of type-safe string functions written in pure JavaScript + JSDoc.

Why str-fns

  • I copy and paste useful functions from my notepad for every project using TypeScript/JavaScript. This library is a library of those functions.
  • I need some useful functions to deal with string types in my projects. This library is a collection of those functions with type-safety.

Why JavaScript + JSDoc / Why not TypeScript

As Svelte team said, TypeScript is a great tool for library authors, but not for library users.
One of the reasons is that it is hard to jump to the definition of a function when using TypeScript.
I want to make it easy to jump to the definition of a function, so I use JavaScript.
Don't worry, I use JSDoc to make it type-safe.

API

  • capitalize - Capitalize the first letter of a string.
  • uncapitalize - Uncapitalize the first letter of a string.
  • uppercase - Convert a string to uppercase.
  • lowercase - Convert a string to lowercase.
  • split - Split a string into substrings using the specified separator and return them as an array.

Related Works

str-fns's People

Contributors

renovate[bot] avatar ryoppippi avatar

Watchers

 avatar  avatar

str-fns's Issues

cannot find type definition

Probably, LSP servers cannot read JSDoc in libraries
so I'll use dts-buddy to generate index.d.ts automatically

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.