Skip to content

Read, select and search profiles โ€‹

Read saved profiles โ€‹

Choose the configuration file explicitly for reproducible imports.

ts
import {WinScpProfileSource} from '@jalsoedesign/winscp-core';

const source = await WinScpProfileSource.fromFile('WinSCP.ini');
const profiles = source.list();

for (const profile of profiles) {
    console.log(profile.path, profile.connections, profile.diagnostics);
}

The file must exist and use a supported native format. The returned profiles contain metadata and credential references, not saved secret values. Loading profiles does not connect to a server.

ts
const selected = source.get('work');
const matches = source.search('example', {fields: 'all'});

if (selected) {
    console.log(selected.source, selected.connections[0]?.endpoint);
}

Selection uses an exact canonical path. Search is case-insensitive; fields: 'all' searches normalized metadata. A missing exact path returns undefined. Inspect diagnostics before assuming a setting has a supported transport equivalent.

Next: storage and discovery, API reference, or write and sync.

To run a complete example locally and compare its actual output, see Run a local demo.

For a complete synthetic fixture and captured return values, use the API quick start. Terminal commands have their own CLI quick start.