Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hansoksendahl committed May 15, 2024
1 parent 9e8384c commit 0e78302
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ npm i @recon-struct/strix

## Usage

The `strix` library takes a deeply nested object of string templates and returns
a function thta can be used to interpolate strings. The function takes a key
corresponding to a template and an object of values to interpolate.

Using the `as const` assertion is recommended to ensure that the object of
templates and variables is treated as a readonly object. This enables the string
interpolation function to provide better type checking and code completion.

Tools like Github Copilot can use the literal string returned by the
interpolation function to provide better code completion.

```typescript
const templates = {
greeting: 'Hello, {{name}}!',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@recon-struct/strix",
"version": "1.0.0",
"version": "1.0.1",
"module": "./src/index.ts",
"devDependencies": {
"@recon-struct/utility-types": "^1.3.4",
Expand Down

0 comments on commit 0e78302

Please sign in to comment.