Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

<div align="center">
<h2>
<a href="https://www.npmjs.com/package/@pleaseai/csp"><img src="https://img.shields.io/npm/v/@pleaseai/csp?color=%23007ec6&label=npm%20package" alt="Package version"></a>
<a href="https://www.npmjs.com/package/@pleaseai/csp"><img src="https://img.shields.io/npm/v/@pleaseai/csp?color=%23007ec6&label=npm" alt="npm version"></a>
<a href="https://crates.io/crates/code-search-please"><img src="https://img.shields.io/crates/v/code-search-please?color=%23dea584&label=crates.io" alt="crates.io version"></a>
<a href="https://codecov.io/gh/pleaseai/code-search"><img src="https://img.shields.io/codecov/c/github/pleaseai/code-search?label=coverage" alt="Coverage"></a>
<a href="https://socket.dev/npm/package/@pleaseai/csp"><img src="https://socket.dev/api/badge/npm/package/@pleaseai/csp" alt="Socket Badge"></a>
<a href="https://github.com/pleaseai/code-search/blob/main/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-green" alt="License - MIT">
</a>
Expand Down Expand Up @@ -442,7 +445,12 @@ csp clear all # 인덱스 캐시와 savings 모두 삭제
<details>
<summary>라이브러리 사용</summary>

Comment thread
amondnet marked this conversation as resolved.
`csp`는 Rust 라이브러리 크레이트(`csp`, [`crates/csp`](crates/csp))로도 사용할 수 있습니다. 자체 도구를 만들거나 검색을 Rust 코드에 직접 통합할 때 유용합니다. `CspIndex`(`from_path` / `from_git` / `search` / `find_related`)와 `ContentType` enum, 랭킹 파이프라인을 노출합니다.
`csp`는 Rust 라이브러리 크레이트로도 사용할 수 있습니다. 짧은 이름 `csp`가 이미 선점되어 있어 crates.io에는 [**`code-search-please`**](https://crates.io/crates/code-search-please)로 배포됩니다. 라이브러리 이름은 `csp` 그대로이므로 의존성은 `code-search-please`로 추가하되 코드에서는 `use csp::...`를 씁니다. `CspIndex`(`from_path` / `from_git` / `search` / `find_related`)와 `ContentType` enum, 랭킹 파이프라인을 노출합니다.

```toml
[dependencies]
code-search-please = "0.1"
```

```rust
use std::path::Path;
Expand All @@ -457,7 +465,7 @@ for r in &results {
}
```

> 크레이트의 [crates.io](https://crates.io) 배포는 예정되어 있습니다. 그 전까지는 path 또는 git 의존으로 사용하세요. (npm 패키지는 `csp` 바이너리를 런처 뒤에 담아 배포할 뿐, JavaScript API를 노출하지 않습니다.)
> 크레이트는 crates.io에 [`code-search-please`](https://crates.io/crates/code-search-please)로 배포되며 라이브러리 이름은 `csp`입니다. (npm 패키지는 `csp` 바이너리를 런처 뒤에 담아 배포할 뿐, JavaScript API를 노출하지 않습니다.)

</details>

Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

<div align="center">
<h2>
<a href="https://www.npmjs.com/package/@pleaseai/csp"><img src="https://img.shields.io/npm/v/@pleaseai/csp?color=%23007ec6&label=npm%20package" alt="Package version"></a>
<a href="https://www.npmjs.com/package/@pleaseai/csp"><img src="https://img.shields.io/npm/v/@pleaseai/csp?color=%23007ec6&label=npm" alt="npm version"></a>
<a href="https://crates.io/crates/code-search-please"><img src="https://img.shields.io/crates/v/code-search-please?color=%23dea584&label=crates.io" alt="crates.io version"></a>
<a href="https://codecov.io/gh/pleaseai/code-search"><img src="https://img.shields.io/codecov/c/github/pleaseai/code-search?label=coverage" alt="Coverage"></a>
<a href="https://socket.dev/npm/package/@pleaseai/csp"><img src="https://socket.dev/api/badge/npm/package/@pleaseai/csp" alt="Socket Badge"></a>
<a href="https://github.com/pleaseai/code-search/blob/main/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-green" alt="License - MIT">
</a>
Expand Down Expand Up @@ -442,7 +445,12 @@ Explicit index paths written with `csp index -o <path>` are not part of the auto
<details>
<summary>Library usage</summary>

Comment thread
amondnet marked this conversation as resolved.
`csp` is also a Rust library crate (`csp`, in [`crates/csp`](crates/csp)), useful when building custom tooling or integrating search directly into your own Rust code. It exposes `CspIndex` with `from_path` / `from_git` / `search` / `find_related`, plus the `ContentType` enum and the ranking pipeline.
`csp` is also a Rust library crate, published on crates.io as [**`code-search-please`**](https://crates.io/crates/code-search-please) (the short name `csp` was already taken). The library name stays `csp`, so you depend on `code-search-please` but still write `use csp::...`. It exposes `CspIndex` with `from_path` / `from_git` / `search` / `find_related`, plus the `ContentType` enum and the ranking pipeline.

```toml
[dependencies]
code-search-please = "0.1"
```

```rust
use std::path::Path;
Expand All @@ -457,7 +465,7 @@ for r in &results {
}
```

> Publishing the crate to [crates.io](https://crates.io) is planned; until then, depend on it by path or git. (The npm package ships only the `csp` binary behind a launcher — it does not expose a JavaScript API.)
> The crate is published on crates.io as [`code-search-please`](https://crates.io/crates/code-search-please) with the library name `csp`. (The npm package ships only the `csp` binary behind a launcher — it does not expose a JavaScript API.)

</details>

Expand Down
Loading