Skip to content

Commit 9f28512

Browse files
committed
first commit
0 parents  commit 9f28512

19 files changed

+7682
-0
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
charset = utf-8
8+
9+
[*.{ts,json,yml}]
10+
indent_style = space
11+
indent_size = 2

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
coverage
3+
dist

.eslintrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["eslint-config-unjs"]
3+
}

.github/workflows/node.js.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
node: [20.x]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: ${{ matrix.node }}
20+
cache: 'npm'
21+
- run: npm ci
22+
- run: npm run build --if-present
23+
- run: npm test

.github/workflows/npm-publish.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Node.js Package
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20.x
16+
cache: 'npm'
17+
- run: npm ci
18+
- run: npm run build --if-present
19+
- run: npm test
20+
21+
publish-npm:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
id-token: write
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 20.x
32+
registry-url: https://registry.npmjs.org/
33+
- run: npm install -g npm
34+
- run: npm ci
35+
- run: npm publish --provenance --access public
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.idea
2+
.vscode
3+
node_modules
4+
dist
5+
coverage
6+
.DS_Store
7+
.eslintcache

.npmignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test/*.test.ts
2+
tsconfig.json
3+
coverage/

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.10

.prettierrc.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"useTabs": false,
3+
"semi": true,
4+
"singleQuote": true,
5+
"tabWidth": 2,
6+
"printWidth": 120,
7+
"bracketSpacing": true,
8+
"trailingComma": "all"
9+
}

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Change Log
2+
This project adheres to [Semantic Versioning](http://semver.org/).
3+
4+
## 0.1.0
5+
* Initial release.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Vladyslav Bondarenko <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# vid
2+
3+
## Install
4+
5+
```bash
6+
npm install @vladbndko/vid
7+
```
8+
9+
## Usage
10+
```ts
11+
import { vid } from '@vladbndko/vid';
12+
13+
vid(); // VJddZKXA4WzDcvAaTxpndD9HlWgPi6wV
14+
15+
vid({ prefix: 'test' }); // testfhTtqilmyYtmF6ZMt1DpfiwZ78Ah4ynr
16+
17+
vid({ length: 10 }); // t9INktucGr
18+
19+
vid({ characters: 'ABC', length: 3 }); // CBA
20+
21+
// Create an instance
22+
const createId = vid.create({ length: 20, prefix: 'test' });
23+
24+
createId(); // testF6ZMt1DpfiwZ78Ah4ynr
25+
```

eslint.config.mjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import unjs from 'eslint-config-unjs';
2+
3+
export default unjs({
4+
ignores: [],
5+
rules: {},
6+
markdown: {
7+
rules: {},
8+
},
9+
});

0 commit comments

Comments
 (0)