move lib to js