{"_id":"kasi","_rev":"3757944","name":"kasi","description":"A collection of functions for working with different casings.","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"time":{"modified":"2025-03-18T07:12:34.000Z","created":"2023-09-17T21:27:59.636Z","1.1.1":"2025-01-18T00:02:05.123Z","1.1.0":"2023-11-10T19:06:59.125Z","1.0.1":"2023-09-18T11:29:30.576Z","1.0.0":"2023-09-17T21:27:59.636Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/kasi.git"},"versions":{"1.1.1":{"name":"kasi","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/kasi.git"},"description":"A collection of functions for working with different casings.","license":"MIT","version":"1.1.1","type":"module","sideEffects":false,"main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["case","casing","check","covert","copy"],"devDependencies":{"benchloop":"^2.1.1","fava":"^0.3.4","tsex":"^4.0.2","typescript":"^5.7.3"},"_id":"kasi@1.1.1","gitHead":"0645980eb4b2cdc9a93e1d795eefa4efc21922b7","bugs":{"url":"https://github.com/fabiospampinato/kasi/issues"},"homepage":"https://github.com/fabiospampinato/kasi#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"shasum":"f18c8d1280c62ba18781494e6c3b377f4323477f","size":5496,"noattachment":false,"key":"/kasi/-/kasi-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/kasi/download/kasi-1.1.1.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/kasi_1.1.1_1737158524868_0.016446901226891075"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-18T00:02:05.123Z","publish_time":1737158525123,"_source_registry_name":"default","_cnpm_publish_time":1737158525123},"1.1.0":{"name":"kasi","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/kasi.git"},"description":"A collection of functions for working with different casings.","version":"1.1.0","type":"module","sideEffects":false,"main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["case","casing","check","covert","copy"],"devDependencies":{"benchloop":"^2.1.1","fava":"^0.3.1","tsex":"^3.0.1","typescript":"^5.2.2"},"gitHead":"80a8dbe2617495600c86e1e5470f065f636fbc7c","bugs":{"url":"https://github.com/fabiospampinato/kasi/issues"},"homepage":"https://github.com/fabiospampinato/kasi#readme","_id":"kasi@1.1.0","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"shasum":"810d4eb3c227cf87302121ff870f25fa980a1ab8","size":9928,"noattachment":false,"key":"/kasi/-/kasi-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/kasi/download/kasi-1.1.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kasi_1.1.0_1699643218950_0.9215501342497019"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-10T19:06:59.125Z","publish_time":1699643219125,"_source_registry_name":"default","_cnpm_publish_time":1699643219125},"1.0.1":{"name":"kasi","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/kasi.git"},"description":"A collection of functions for working with different casings.","version":"1.0.1","type":"module","sideEffects":false,"main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["case","casing","check","covert","copy"],"devDependencies":{"benchloop":"^2.1.1","fava":"^0.3.1","tsex":"^3.0.1","typescript":"^5.2.2"},"gitHead":"d086c75e06c6d77511f7e5fd6f6358a82ad099d4","bugs":{"url":"https://github.com/fabiospampinato/kasi/issues"},"homepage":"https://github.com/fabiospampinato/kasi#readme","_id":"kasi@1.0.1","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"shasum":"6adb7d4ffcf9b8b7e9d378b834e376a6ec63168a","size":7996,"noattachment":false,"key":"/kasi/-/kasi-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/kasi/download/kasi-1.0.1.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kasi_1.0.1_1695036570351_0.5885421971109206"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-18T11:29:30.576Z","publish_time":1695036570576,"_source_registry_name":"default","_cnpm_publish_time":1695036570576},"1.0.0":{"name":"kasi","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/kasi.git"},"description":"A collection of functions for working with different casings.","version":"1.0.0","type":"module","sideEffects":false,"main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"benchmark":"tsex benchmark","benchmark:watch":"tsex benchmark --watch","clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["case","casing","check","covert","copy"],"devDependencies":{"benchloop":"^2.1.1","fava":"^0.3.1","tsex":"^3.0.1","typescript":"^5.2.2"},"gitHead":"bf1b62fc9769107e401cf212ed887e0576dc1bcc","bugs":{"url":"https://github.com/fabiospampinato/kasi/issues"},"homepage":"https://github.com/fabiospampinato/kasi#readme","_id":"kasi@1.0.0","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"shasum":"0fecdbd2e0059ad57a64da691df84b5e93eb7bfc","size":7755,"noattachment":false,"key":"/kasi/-/kasi-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/kasi/download/kasi-1.0.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/kasi_1.0.0_1694986079445_0.6279433251780011"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-17T21:27:59.636Z","publish_time":1694986079636,"_source_registry_name":"default","_cnpm_publish_time":1694986079636}},"readme":"# Kasi\n\nA collection of functions for working with different casings.\n\n## Install\n\n```sh\nnpm install kasi\n```\n\n## Functions\n\n| Check                             | Convert                           | Extra             |\n| --------------------------------- | --------------------------------- | ----------------- |\n| [isCamelCase](#iscamelcase)       | [toCamelCase](#tocamelcase)       | [apply](#apply)   |\n| [isConstantCase](#isconstantcase) | [toConstantCase](#toconstantcase) | [copy](#copy)     |\n| [isDotCase](#isdotcase)           | [toDotCase](#todotcase)           | [detect](#detect) |\n| [isKebabCase](#iskebabcase)       | [toKebabCase](#tokebabcase)       |                   |\n| [isLowerCase](#islowercase)       | [toLowerCase](#tolowercase)       |                   |\n| [isPascalCase](#ispascalcase)     | [toPascalCase](#topascalcase)     |                   |\n| [isPathCase](#ispathcase)         | [toPathCase](#topathcase)         |                   |\n| [isSnakeCase](#issnakecase)       | [toSnakeCase](#tosnakecase)       |                   |\n| [isTitleCase](#istitlecase)       | [toTitleCase](#totitlecase)       |                   |\n| [isUpperCase](#isuppercase)       | [toUpperCase](#touppercase)       |                   |\n\n### Check\n\nThese functions allow you to check if a string is using a specific casing.\n\n#### `isCamelCase`\n\n```ts\nimport {isCamelCase} from 'kasi';\n\nisCamelCase ( 'fooBar' ); // => true\nisCamelCase ( 'foo-bar' ); // => false\n```\n\n#### `isConstantCase`\n\n```ts\nimport {isConstantCase} from 'kasi';\n\nisConstantCase ( 'FOO_BAR' ); // => true\nisConstantCase ( 'fooBar' ); // => false\n```\n\n#### `isDotCase`\n\n```ts\nimport {isDotCase} from 'kasi';\n\nisDotCase ( 'foo.bar' ); // => true\nisDotCase ( 'fooBar' ); // => false\n```\n\n#### `isKebabCase`\n\n```ts\nimport {isKebabCase} from 'kasi';\n\nisKebabCase ( 'foo-bar' ); // => true\nisKebabCase ( 'fooBar' ); // => false\n```\n\n#### `isLowerCase`\n\n```ts\nimport {isLowerCase} from 'kasi';\n\nisLowerCase ( 'foo' ); // => true\nisLowerCase ( 'Foo' ); // => false\n```\n\n#### `isPascalCase`\n\n```ts\nimport {isPascalCase} from 'kasi';\n\nisPascalCase ( 'FooBar' ); // => true\nisPascalCase ( 'fooBar' ); // => false\n```\n\n#### `isPathCase`\n\n```ts\nimport {isPathCase} from 'kasi';\n\nisPathCase ( 'foo/bar' ); // => true\nisPathCase ( 'fooBar' ); // => false\n```\n\n#### `isSnakeCase`\n\n```ts\nimport {isSnakeCase} from 'kasi';\n\nisSnakeCase ( 'foo_bar' ); // => true\nisSnakeCase ( 'fooBar' ); // => false\n```\n\n#### `isTitleCase`\n\n```ts\nimport {isTitleCase} from 'kasi';\n\nisTitleCase ( 'Foo Bar' ); // => true\nisTitleCase ( 'fooBar' ); // => false\n```\n\n#### `isUpperCase`\n\n```ts\nimport {isUpperCase} from 'kasi';\n\nisUpperCase ( 'FOO' ); // => true\nisUpperCase ( 'foo' ); // => false\n```\n\n### Convert\n\nThese functions allow you to convert a string to a specific casing.\n\n#### `toCamelCase`\n\n```ts\nimport {toCamelCase} from 'kasi';\n\ntoCamelCase ( 'foo-bar' ); // => 'fooBar'\ntoCamelCase ( 'foo_bar' ); // => 'fooBar'\n```\n\n#### `toConstantCase`\n\n```ts\nimport {toConstantCase} from 'kasi';\n\ntoConstantCase ( 'fooBar' ); // => 'FOO_BAR'\ntoConstantCase ( 'foo-bar' ); // => 'FOO_BAR'\n```\n\n#### `toDotCase`\n\n```ts\nimport {toDotCase} from 'kasi';\n\ntoDotCase ( 'fooBar' ); // => 'foo.bar'\ntoDotCase ( 'foo-bar' ); // => 'foo.bar'\n```\n\n#### `toKebabCase`\n\n```ts\nimport {toKebabCase} from 'kasi';\n\ntoKebabCase ( 'fooBar' ); // => 'foo-bar'\ntoKebabCase ( 'foo_bar' ); // => 'foo-bar'\n```\n\n#### `toLowerCase`\n\n```ts\nimport {toLowerCase} from 'kasi';\n\ntoLowerCase ( 'FooBar' ); // => 'foobar'\ntoLowerCase ( 'foo-bar' ); // => 'foo-bar'\n```\n\n#### `toPascalCase`\n\n```ts\nimport {toPascalCase} from 'kasi';\n\ntoPascalCase ( 'foo-bar' ); // => 'FooBar'\ntoPascalCase ( 'foo_bar' ); // => 'FooBar'\n```\n\n#### `toPathCase`\n\n```ts\nimport {toPathCase} from 'kasi';\n\ntoPathCase ( 'fooBar' ); // => 'foo/bar'\ntoPathCase ( 'foo-bar' ); // => 'foo/bar'\n```\n\n#### `toSnakeCase`\n\n```ts\nimport {toSnakeCase} from 'kasi';\n\ntoSnakeCase ( 'fooBar' ); // => 'foo_bar'\ntoSnakeCase ( 'foo-bar' ); // => 'foo_bar'\n```\n\n#### `toTitleCase`\n\n```ts\nimport {toTitleCase} from 'kasi';\n\ntoTitleCase ( 'fooBar' ); // => 'Foo Bar'\ntoTitleCase ( 'foo-bar' ); // => 'Foo Bar'\n```\n\n#### `toUpperCase`\n\n```ts\nimport {toUpperCase} from 'kasi';\n\ntoUpperCase ( 'fooBar' ); // => 'FOOBAR'\ntoUpperCase ( 'foo-bar' ); // => 'FOO-BAR'\n```\n\n### Extra\n\nThese extra functions perform other operations related to casings.\n\n#### `apply`\n\nTransform a string to the given casing. Useful in combination with `detect`.\n\n```ts\nimport {apply} from 'kasi';\n\napply ( 'foo-bar', 'camel' ); // => 'fooBar'\napply ( 'foo-bar', 'constant' ); // => 'FOO_BAR'\n```\n\n#### `copy`\n\nThis function copies the casing of a string to another string, character by character. The two strings must have the same length.\n\n```ts\nimport {copy} from 'kasi';\n\ncopy ( 'sIlLy', 'lions' ); // => 'lIoNs'\ncopy ( 'SiLlY', 'lions' ); // => 'LiOnS'\n```\n\n#### `detect`\n\nThis function detects the casing of a string. Useful in combination with `apply`.\n\n```ts\nimport {detect} from 'kasi';\n\ndetect ( 'fooBar' ); // => 'camel'\ndetect ( 'FOO_BAR' ); // => 'constant'\ndetect ( ' foo BAR ' ); // => 'unknown'\n```\n\n## Related\n\n- **[Kasi for VSCode](https://marketplace.visualstudio.com/items?itemName=fabiospampinato.kasi)**: The official companion extension for Kasi, for quickly changing the casing of your selections.\n\n## License\n\nMIT © Fabio Spampinato\n","_attachments":{},"homepage":"https://github.com/fabiospampinato/kasi#readme","bugs":{"url":"https://github.com/fabiospampinato/kasi/issues"},"license":"MIT"}