Git Product home page Git Product logo

nyxlang / string-utils Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2.73 MB

A utility belt of string functions to handle nearly any string manipulation or task

Home Page: https://nyxlang.github.io/string-utils/

License: MIT License

Shell 0.19% JavaScript 99.81%
string strings string-manipulation grapheme-cluster unicode internationalization string-encoding string-decode string-casing string-join string-split string-query string-slicer

string-utils's Introduction

Nyx String Utilities

Nyx String Utilities offers a wide range of string processing and manipulation functions to handle a wide variety of text wrangling tasks. The library is the backbone of the Nyx Programming Language's String type, but it is also perfectly suitable for use in other projects.

Installation

npm install @nyxlang/string-utils

Usage

You can use the ES2015 import statement to include the package:

import * as su from "@nyxlang/string-utils";

Or if you need CommonJS you can require it:

const su = require("@nyxlang/string-utils");

Or simply import the individual functions you need:

// ES2015 import
import { camelCase, decodeUTF8, graphemes } from "@nyxlang/string-utils";

// CommonJS
const { camelCase, decodeUTF8, graphemes } = require("@nyxlang/string-utils");

Then simply call library functions as methods on the su object:

camelcase("++this-__is-spartaaaaa++");
// => "thisIsSpartaaaaa"

graphemes("अनुच्छेद");
// => ["अ", "नु", "च्", "छे", "द"]

decodeUTF8([0xf0, 0x9f, 0x98, 0x80, 0xf0, 0x9f, 0x98, 0x81]);
// => "😀😁"

Complete API documentation

string-utils's People

Contributors

jasonsbarr avatar

Watchers

 avatar  avatar

string-utils's Issues

Tests broken because Jest won't resolve imports

I'm opening an issue in case anyone comes across this who knows how to fix this problem.

I'm using Jest for testing and ES2015 modules to import and export internally. Unfortunately the one external dependency I have breaks Jest when I try to test any functions that use that dependency. Everything I'm importing as far as internal package code works fine, it's just when I try to import a dependency. It works, when I just use node to run the function everything does as expected. It's just that when I use Jest the tests break because it won't resolve the import for the external module.

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.