node-csv icon indicating copy to clipboard operation
node-csv copied to clipboard

support headers as comment

Open bluelovers opened this issue 1 year ago • 3 comments

Summary

A clear and concise description of what the feature is.

Motivation

If the feature is related to a problem, describe it. Add any other context explaining why this feature is of interest to you and the community.

Alternative

A clear and concise description of alternative solutions or features you've considered.

Draft

something like this

if (options?.headers_as_comment)
	{
		const headers = columns.slice();
		// @ts-ignore
		headers[0] = options.comment + ' ' + headers[0];

		list = [
			headers,
			...list,
		]
	}

	return stringify(list, {
		delimiter,
	})

Additional context

# domain	path	name	value	expires
xxx.cc	/	connect.sid	xxx	Mon, 03-Feb-2025 19:32:17 GMT
xxx.cc	/	connect.sid	xxx	Mon, 03-Feb-2025 19:32:17 GMT
xxx.cc	/	connect.sid2	xxx	Wed, 14-Jun-2017 07:00:00 GMT
xxx.cc	/	connect.sid3	xxx	Wed, 31-Dec-1969 23:59:59 GMT
xxx.cc	/	connect.sid	xxx	Mon, 03-Feb-2025 19:32:17 GMT
xxx.cc	/	connect.sid	xxx	Mon, 03-Feb-2025 19:32:17 GMT
xxx.cc	/	connect.sid	xxx	Mon, 03-Feb-2025 19:32:17 GMT
xxx.cc	/	connect.sid	xxx	Mon, 03-Feb-2025 19:32:17 GMT

Add any other context or screenshots about the feature request here.

bluelovers avatar Feb 10 '24 09:02 bluelovers

Good idea, let me know if you are thinking to submit a merge request.

wdavidw avatar Feb 10 '24 13:02 wdavidw

i don't know how to make a good pr

bluelovers avatar Feb 10 '24 17:02 bluelovers

I can do it. If you wish to give it a try, there are a lot of tutorials on how to fork this repo and propose some changes. I'll mentor you if necessary (in such case, give me access to your fork).

wdavidw avatar Feb 11 '24 11:02 wdavidw